buildFHS{Chroot,User}Env: support extraInstallCommands

This commit is contained in:
Nikolay Amiantov 2015-12-04 00:25:59 +03:00
parent 634c9db4c2
commit 00f6ce133c
3 changed files with 9 additions and 4 deletions

View File

@ -1,4 +1,4 @@
{ stdenv } : { env } :
{ stdenv } : { env, extraInstallCommands ? "" } :
let
# References to shell scripts that set up or tear down the environment
@ -43,5 +43,6 @@ in stdenv.mkDerivation {
-e "s|@name@|${name}|g" \
${destroySh} > destroy-${name}-chrootenv
chmod +x destroy-${name}-chrootenv
${extraInstallCommands}
'';
}

View File

@ -1,4 +1,5 @@
{ runCommand, lib, writeText, writeScriptBin, stdenv, ruby } : { env, runScript ? "bash", extraBindMounts ? [] } :
{ runCommand, lib, writeText, writeScriptBin, stdenv, ruby } :
{ env, runScript ? "bash", extraBindMounts ? [], extraInstallCommands ? "" } :
let
name = env.pname;
@ -44,4 +45,5 @@ in runCommand name {
exec ${chroot-user}/bin/chroot-user ${env} bash -l ${init runScript} "\$(pwd)" "\$@"
EOF
chmod +x $out/bin/${name}
${extraInstallCommands}
''

View File

@ -273,13 +273,15 @@ let
};
buildFHSChrootEnv = args: chrootFHSEnv {
env = buildFHSEnv args;
env = buildFHSEnv (removeAttrs args [ "extraInstallCommands" ]);
extraInstallCommands = args.extraInstallCommands or "";
};
buildFHSUserEnv = args: userFHSEnv {
env = buildFHSEnv (removeAttrs args [ "runScript" "extraBindMounts" ]);
env = buildFHSEnv (removeAttrs args [ "runScript" "extraBindMounts" "extraInstallCommands" ]);
runScript = args.runScript or "bash";
extraBindMounts = args.extraBindMounts or [];
extraInstallCommands = args.extraInstallCommands or "";
};
buildMaven = callPackage ../build-support/build-maven.nix {};