liminix/pkgs/service-fns/default.nix

14 lines
299 B
Nix
Raw Normal View History

2023-03-03 23:20:59 +01:00
{writeText}:
writeText "service-fns.sh" ''
output() { cat $1/.outputs/$2; }
output_path() { echo $(realpath $1/.outputs)/$2; }
mkoutputs() {
d=/run/service-state/$1
mkdir -m 2751 -p $d && chown root:system $d
2023-03-03 23:20:59 +01:00
echo $d
}
in_outputs() {
cd `mkoutputs $1` && umask 0027
}
2023-03-03 23:20:59 +01:00
''