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.
15 lines
296 B
Nix
15 lines
296 B
Nix
{ ... }:
|
|
{
|
|
sig = "String -> Permission";
|
|
doc = ''
|
|
Prepends the passed string to `$PATH`.
|
|
'';
|
|
impl =
|
|
path: state:
|
|
state
|
|
// {
|
|
env = state.env // {
|
|
PATH = if state.env ? PATH && state.env.PATH != "" then "${path}:${state.env.PATH}" else path;
|
|
};
|
|
};
|
|
}
|