mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 04:19:00 +02:00
buildFHSUserEnv: add version arg
This lets you set the version for the derivation produced from `buildFHSUserEnvChroot` and `buildFHSUserEnvBubblewrap`. This can help to make it more clear to end-users to see the versions of the packages they are using.
This commit is contained in:
parent
de408167ed
commit
23ee769358
|
@ -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"
|
||||
]);
|
||||
|
||||
etcBindFlags = let
|
||||
|
@ -192,7 +194,11 @@ let
|
|||
|
||||
bin = writeShellScriptBin name (bwrapCmd { initArgs = ''"$@"''; });
|
||||
|
||||
in runCommandLocal name {
|
||||
versionStr = lib.optionalString (! isNull version) ("-" + 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 (! isNull version) ("-" + version);
|
||||
|
||||
nameAndVersion = name + versionStr;
|
||||
|
||||
in runCommandLocal nameAndVersion {
|
||||
inherit meta;
|
||||
|
||||
passthru = passthru // {
|
||||
|
|
Loading…
Reference in a new issue