All modules with preStart: Use systemd.tmpfiles.rules

This is NixOS' recommended way to setup service dirs
https://github.com/NixOS/nixpkgs/pull/56265. This commit hands off the
initial data directory creation to systemd.tmpfiles.rules. All other
preStart scripts are left intact to limit this changes' scope.
This commit is contained in:
nixbitcoin
2020-05-22 14:54:39 +00:00
parent 423ebf862b
commit 91b6b2c370
8 changed files with 31 additions and 18 deletions
+5 -2
View File
@@ -28,9 +28,8 @@ let
'';
createWebIndex = pkgs.writeText "make-index.sh" ''
set -e
mkdir -p /var/www/
cp ${indexFile} /var/www/index.html
chown -R nginx /var/www/
chown -R nginx:nginx /var/www/
nodeinfo
. <(nodeinfo)
sed -i "s/CLIGHTNING_ID/$CLIGHTNING_ID/g" /var/www/index.html
@@ -48,6 +47,10 @@ in {
};
config = mkIf cfg.enable {
systemd.tmpfiles.rules = [
"d /var/www 0755 nginx nginx - -"
];
services.nginx = {
enable = true;
virtualHosts."_" = {