Merge pull request #219091 from cdepillabout/buildfhsuserenv-version
buildFHSUserEnv: add version arg
This commit is contained in:
commit
bdf0dd28b9
@ -2,6 +2,7 @@
|
||||
|
||||
args @ {
|
||||
name
|
||||
, version ? null
|
||||
, runScript ? "bash"
|
||||
, extraInstallCommands ? ""
|
||||
, meta ? {}
|
||||
@ -24,6 +25,7 @@ let
|
||||
env = buildFHSEnv (removeAttrs args [
|
||||
"runScript" "extraInstallCommands" "meta" "passthru" "extraBwrapArgs" "dieWithParent"
|
||||
"unshareUser" "unshareCgroup" "unshareUts" "unshareNet" "unsharePid" "unshareIpc"
|
||||
"version"
|
||||
]);
|
||||
|
||||
etcBindEntries = let
|
||||
@ -203,7 +205,11 @@ let
|
||||
|
||||
bin = writeShellScriptBin name (bwrapCmd { initArgs = ''"$@"''; });
|
||||
|
||||
in runCommandLocal name {
|
||||
versionStr = lib.optionalString (version != null) ("-" + version);
|
||||
|
||||
nameAndVersion = name + versionStr;
|
||||
|
||||
in runCommandLocal nameAndVersion {
|
||||
inherit meta;
|
||||
|
||||
passthru = passthru // {
|
||||
|
@ -1,11 +1,11 @@
|
||||
{ callPackage, runCommandLocal, writeScript, stdenv, coreutils }:
|
||||
{ lib, callPackage, runCommandLocal, writeScript, stdenv, coreutils }:
|
||||
|
||||
let buildFHSEnv = callPackage ./env.nix { }; in
|
||||
|
||||
args@{ name, runScript ? "bash", extraInstallCommands ? "", meta ? {}, passthru ? {}, ... }:
|
||||
args@{ name, version ? null, runScript ? "bash", extraInstallCommands ? "", meta ? {}, passthru ? {}, ... }:
|
||||
|
||||
let
|
||||
env = buildFHSEnv (removeAttrs args [ "runScript" "extraInstallCommands" "meta" "passthru" ]);
|
||||
env = buildFHSEnv (removeAttrs args [ "version" "runScript" "extraInstallCommands" "meta" "passthru" ]);
|
||||
|
||||
chrootenv = callPackage ./chrootenv {};
|
||||
|
||||
@ -23,7 +23,11 @@ let
|
||||
exec ${run} "$@"
|
||||
'';
|
||||
|
||||
in runCommandLocal name {
|
||||
versionStr = lib.optionalString (version != null) ("-" + version);
|
||||
|
||||
nameAndVersion = name + versionStr;
|
||||
|
||||
in runCommandLocal nameAndVersion {
|
||||
inherit meta;
|
||||
|
||||
passthru = passthru // {
|
||||
|
Loading…
Reference in New Issue
Block a user