Jail.nix does not expose `$PATH` by default because the automatic runtime-closure binding often means your `$PATH` won't work anyway. However, for some jails, you may want to disable the runtime-closure binding and just bind your whole nix store. In those cases, it would be nice if `fwd-env "PATH"` worked correctly.
24 lines
497 B
Nix
24 lines
497 B
Nix
{ combinators, lib, ... }:
|
|
let
|
|
inherit (combinators) compose add-path;
|
|
in
|
|
{
|
|
sig = "[Package] -> Permission";
|
|
doc = ''
|
|
Adds the packages' `bin` directory to `$PATH`.
|
|
'';
|
|
impl =
|
|
pkgsToAdd:
|
|
compose (
|
|
builtins.map (pkg: add-path "${lib.getBin pkg}/bin") pkgsToAdd
|
|
++ [
|
|
(
|
|
state:
|
|
state
|
|
// {
|
|
additionalRuntimeClosures = state.additionalRuntimeClosures ++ (map toString pkgsToAdd);
|
|
}
|
|
)
|
|
]
|
|
);
|
|
}
|