Fix fwd-env "PATH" not working
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.
This commit is contained in:
parent
2ec4595d3b
commit
42b355c38c
5 changed files with 45 additions and 5 deletions
|
|
@ -4,5 +4,12 @@
|
|||
doc = ''
|
||||
Prepends the passed string to `$PATH`.
|
||||
'';
|
||||
impl = path: state: state // { path = [ path ] ++ state.path; };
|
||||
impl =
|
||||
path: state:
|
||||
state
|
||||
// {
|
||||
env = state.env // {
|
||||
PATH = if state.env ? PATH && state.env.PATH != "" then "${path}:${state.env.PATH}" else path;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue