nixos/kresd: use systemd.tmpfiles

Since 4e4161c212 it works on nixos-rebuild.
This commit is contained in:
Vladimír Čunát 2018-01-09 17:11:36 +01:00
parent f19d959ef1
commit f312e6d993
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA

View File

@ -86,16 +86,7 @@ in
};
};
# Create the cacheDir; tmpfiles don't work on nixos-rebuild switch.
systemd.services.kresd-cachedir = {
serviceConfig.Type = "oneshot";
script = ''
if [ ! -d '${cfg.cacheDir}' ]; then
mkdir -p '${cfg.cacheDir}'
chown kresd:kresd '${cfg.cacheDir}'
fi
'';
};
systemd.tmpfiles.rules = [ "d '${cfg.cacheDir}' 0770 kresd kresd - -" ];
systemd.services.kresd = {
description = "Knot-resolver daemon";
@ -111,8 +102,7 @@ in
-k '${cfg.cacheDir}/root.key'
'';
after = [ "kresd-cachedir.service" ];
requires = [ "kresd.socket" "kresd-cachedir.service" ];
requires = [ "kresd.socket" ];
};
};
}