jail.nix/lib/helpers.nix
2025-09-11 07:31:48 -07:00

14 lines
337 B
Nix

pkgs: rec {
dataDir = "~/.local/share/jail.nix";
dataDirSubPath = subPath: "${dataDir}/${escape subPath}";
noescape = value: { _noescape = value; };
escape =
rawOrStr:
if builtins.typeOf rawOrStr == "set" && rawOrStr ? _noescape then
rawOrStr._noescape
else
pkgs.lib.strings.escapeShellArg rawOrStr;
}