Bind write-text/bind-pkg runtime closure
39ca901 introduced only bind-mounting in the individual store paths that make up the runtime closure for the jail. However, in practice I found a few jails that were using `write-text` for configuration files that referenced other store paths were no longer being bind mounted into the jail. I think it's reasonable that if you `write-text` or `bind-pkg`, and it has runtime dependencies, those dependencies should be made available to the jail.
This commit is contained in:
parent
7d3efead61
commit
b28610bb1e
3 changed files with 10 additions and 1 deletions
|
|
@ -634,6 +634,7 @@ in rec {
|
|||
include-once "bind-nix-store-runtime-closure" (defer (state:
|
||||
let
|
||||
runtimeClosure = pkgs.writeText "${state.name}-runtime-closure" ''
|
||||
${pkgs.lib.concatStringsSep "\n" state.additionalRuntimeClosures}
|
||||
${pkgs.lib.concatStringsSep "\n" state.path}
|
||||
${state.argv}
|
||||
${state.entry}
|
||||
|
|
@ -872,7 +873,10 @@ in rec {
|
|||
```
|
||||
'';
|
||||
__functor = _:
|
||||
path: pkg: ro-bind (toString pkg) path
|
||||
path: pkg: compose [
|
||||
(ro-bind (toString pkg) path)
|
||||
(state: state // { additionalRuntimeClosures = state.additionalRuntimeClosures ++ [ pkg ]; })
|
||||
]
|
||||
;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ in {
|
|||
includedOnce = []; # See include-once combinator
|
||||
cleanup = []; # See cleanup combinator
|
||||
deferredPermissions = []; # See defer combinator
|
||||
additionalRuntimeClosures = []; # See bind-nix-store-runtime-closure
|
||||
};
|
||||
in lib.pipe initialState (
|
||||
# Permissions shared by all invocations of jail
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue