Refactor path handling
* Moves the default coreutils path into base permissions to allow override. * Makes paths defined *later* in the permissions list appear *earlier* which should have the effect of later calls to `add-path` override binaries provided by earlier ones. * Makes the `path` variable on state a list rather than a string.
This commit is contained in:
parent
7f17289a72
commit
06c7210127
4 changed files with 7 additions and 5 deletions
|
|
@ -23,7 +23,7 @@ in {
|
|||
name = name;
|
||||
cmd = "${lib.getExe pkgs.bubblewrap}";
|
||||
entry = if builtins.typeOf exe == "string" then lib.escapeShellArg exe else lib.getExe exe;
|
||||
path = "${pkgs.coreutils}/bin";
|
||||
path = [];
|
||||
argv = "\"$@\"";
|
||||
runtime = "";
|
||||
new-session = true;
|
||||
|
|
@ -51,7 +51,7 @@ in {
|
|||
unsafe-add-raw-args
|
||||
] s
|
||||
)
|
||||
(s: set-env "PATH" s.path s)
|
||||
(s: if builtins.length s.path > 0 then set-env "PATH" (lib.concatStringsSep ":" s.path) s else s)
|
||||
(s: if s.new-session then unsafe-add-raw-args "--new-session" s else s)
|
||||
(s: lib.foldr (envVar:
|
||||
assert pkgs.lib.isValidPosixName envVar;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue