jail.nix/lib/helpers.nix
2025-08-07 15:54:50 -07:00

12 lines
325 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;
}