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 one is a bit confusing since these docs document a nix multi-line
string within a multi-line string, *and* there is a bash interpolation
within. We want the docs to render as `if [ -e "''${TMPFILE-}" ]`, since
the docs are within a multi-line string.
Sorry in advance for anyone attempting to parse this in the nix source
code instead of the docs website :(.
* 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.
The term `combinator` was overloaded before, being used to refer both to
the functions that are exposed to help build a jail, and their return
value to be passed into `jail`/`basePermissions`. This commit renames
the latter to `Permission`.
This remove the requirement on `which` binary when running any jail.
This was preventing jailed apps from running within nix sandbox without
manually specifying `pkgs.which` as a build input.
Instead of requiring the third argument to be a function that passes in
combinators, this exposes all combinators on `jail.combinators` and
allows the third argument to just be a list (or even null!). This may be
more ergonomic in some contexts (like nixpkgs overlays).
This isn't a breaking change, the third argument can still be a function
and will receive the combinators if it is.
By using `__functor` combinators can call each other directly by using
`rec` rather than needing to mapAttrs over all of the combinators to
inject them into each one.
This adds structured documentation and signatures to all combinators. A
future commit will consume this to generate a documentation website.
But for now having the docs in the source code is helpful to anyone
viewing `combinators.nix`.