liminix-fork/pkgs/service-fns/default.nix
Daniel Barlow aecbe08f08 add o+x permission on service-state directories
this is needed for resolvconf, which writes resolv.conf as
an output and wants to make it world-readable
2023-08-28 22:02:28 +01:00

13 lines
299 B
Nix

{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
echo $d
}
in_outputs() {
cd `mkoutputs $1` && umask 0027
}
''