The `lib/combinators.nix` file was getting quite long and some ideas I have for future combinators may even require ancillary files. To help scale these changes, this commit breaks each combinator into its own file under the `lib/combinators` directory.
27 lines
689 B
Nix
27 lines
689 B
Nix
{ combinators, helpers, ... }:
|
|
let
|
|
inherit (combinators)
|
|
add-runtime
|
|
compose
|
|
noescape
|
|
rw-bind
|
|
;
|
|
in
|
|
{
|
|
sig = "String -> Permission";
|
|
doc = ''
|
|
Persists the home directory across all jails with the specified name.
|
|
|
|
This is useful for a lot of software that may want to write arbitrary
|
|
things into your home directory and expect to read them back in a future
|
|
invocation.
|
|
|
|
The home directory is persisted in `~/.local/share/jail.nix/home/<name>`.
|
|
'';
|
|
impl =
|
|
name:
|
|
compose [
|
|
(add-runtime "mkdir -p ${helpers.dataDirSubPath "home/${name}"}")
|
|
(rw-bind (noescape (helpers.dataDirSubPath "home/${name}")) (noescape "~"))
|
|
];
|
|
}
|