jail.nix/lib/helpers.nix

14 lines
337 B
Nix
Raw Normal View History

2025-08-07 15:29:16 -07:00
pkgs: rec {
dataDir = "~/.local/share/jail.nix";
dataDirSubPath = subPath: "${dataDir}/${escape subPath}";
noescape = value: { _noescape = value; };
2025-09-11 07:31:48 -07:00
escape =
rawOrStr:
if builtins.typeOf rawOrStr == "set" && rawOrStr ? _noescape then
rawOrStr._noescape
else
pkgs.lib.strings.escapeShellArg rawOrStr;
2025-08-07 15:29:16 -07:00
}