mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
buildFHS{Chroot,User}Env: support extraInstallCommands
This commit is contained in:
parent
634c9db4c2
commit
00f6ce133c
@ -1,4 +1,4 @@
|
|||||||
{ stdenv } : { env } :
|
{ stdenv } : { env, extraInstallCommands ? "" } :
|
||||||
|
|
||||||
let
|
let
|
||||||
# References to shell scripts that set up or tear down the environment
|
# References to shell scripts that set up or tear down the environment
|
||||||
@ -43,5 +43,6 @@ in stdenv.mkDerivation {
|
|||||||
-e "s|@name@|${name}|g" \
|
-e "s|@name@|${name}|g" \
|
||||||
${destroySh} > destroy-${name}-chrootenv
|
${destroySh} > destroy-${name}-chrootenv
|
||||||
chmod +x destroy-${name}-chrootenv
|
chmod +x destroy-${name}-chrootenv
|
||||||
|
${extraInstallCommands}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
@ -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
|
let
|
||||||
name = env.pname;
|
name = env.pname;
|
||||||
@ -44,4 +45,5 @@ in runCommand name {
|
|||||||
exec ${chroot-user}/bin/chroot-user ${env} bash -l ${init runScript} "\$(pwd)" "\$@"
|
exec ${chroot-user}/bin/chroot-user ${env} bash -l ${init runScript} "\$(pwd)" "\$@"
|
||||||
EOF
|
EOF
|
||||||
chmod +x $out/bin/${name}
|
chmod +x $out/bin/${name}
|
||||||
|
${extraInstallCommands}
|
||||||
''
|
''
|
||||||
|
@ -273,13 +273,15 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
buildFHSChrootEnv = args: chrootFHSEnv {
|
buildFHSChrootEnv = args: chrootFHSEnv {
|
||||||
env = buildFHSEnv args;
|
env = buildFHSEnv (removeAttrs args [ "extraInstallCommands" ]);
|
||||||
|
extraInstallCommands = args.extraInstallCommands or "";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildFHSUserEnv = args: userFHSEnv {
|
buildFHSUserEnv = args: userFHSEnv {
|
||||||
env = buildFHSEnv (removeAttrs args [ "runScript" "extraBindMounts" ]);
|
env = buildFHSEnv (removeAttrs args [ "runScript" "extraBindMounts" "extraInstallCommands" ]);
|
||||||
runScript = args.runScript or "bash";
|
runScript = args.runScript or "bash";
|
||||||
extraBindMounts = args.extraBindMounts or [];
|
extraBindMounts = args.extraBindMounts or [];
|
||||||
|
extraInstallCommands = args.extraInstallCommands or "";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildMaven = callPackage ../build-support/build-maven.nix {};
|
buildMaven = callPackage ../build-support/build-maven.nix {};
|
||||||
|
Loading…
Reference in New Issue
Block a user