Rework persisthome
* Use new data dir for persisted homes (~/.local/share/jail.nix/home instead of ~/.local/share/jails) * Rename `persisthome` -> `persist-home` (with deprecation warning when using the old name)
This commit is contained in:
parent
8da2af4368
commit
d84314ffc7
2 changed files with 13 additions and 3 deletions
|
|
@ -78,8 +78,17 @@ in rec {
|
||||||
path
|
path
|
||||||
(pkgs.writeText "jail-write-text-${lib.strings.sanitizeDerivationName (escape path)}" contents);
|
(pkgs.writeText "jail-write-text-${lib.strings.sanitizeDerivationName (escape path)}" contents);
|
||||||
|
|
||||||
persisthome = name: compose [
|
persist-home = name: compose [
|
||||||
|
(add-runtime "mkdir -p ${helpers.dataDirSubPath "home/${name}"}")
|
||||||
|
(rw-bind (noescape (helpers.dataDirSubPath "home/${name}")) (noescape "~"))
|
||||||
|
];
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# deprecated
|
||||||
|
persisthome = name: helpers.deprecatedCombinator
|
||||||
|
"persisthome is deprecated, use persist-home instead. When doing so, rename ~/.local/share/jails/${name} to ${helpers.dataDirSubPath "home/${name}"}"
|
||||||
|
(compose [
|
||||||
(add-runtime "mkdir -p ~/.local/share/jails/${lib.escapeShellArg name}")
|
(add-runtime "mkdir -p ~/.local/share/jails/${lib.escapeShellArg name}")
|
||||||
(rw-bind (noescape "~/.local/share/jails/${lib.escapeShellArg name}") (noescape "~"))
|
(rw-bind (noescape "~/.local/share/jails/${lib.escapeShellArg name}") (noescape "~"))
|
||||||
];
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
lib.nix
1
lib.nix
|
|
@ -8,6 +8,7 @@
|
||||||
noescape = value: { raw = value; };
|
noescape = value: { raw = value; };
|
||||||
dataDir = "~/.local/share/jail.nix";
|
dataDir = "~/.local/share/jail.nix";
|
||||||
dataDirSubPath = subPath: "${dataDir}/${escape subPath}";
|
dataDirSubPath = subPath: "${dataDir}/${escape subPath}";
|
||||||
|
deprecatedCombinator = message: combinator: lib.warn "jail ${name}: ${message}" combinator;
|
||||||
};
|
};
|
||||||
|
|
||||||
combinators = import ./combinators.nix {
|
combinators = import ./combinators.nix {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue