about summary refs log tree commit diff
path: root/nixpkgs
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-06-04 04:04:28 +0000
committerAlyssa Ross <hi@alyssa.is>2020-06-04 04:12:49 +0000
commitd8c13504316fc1466567454edab1122909f0fa48 (patch)
tree9c23559d67d7ec2566c13ca558cf1ed06af61e93 /nixpkgs
parent0678d4e9e0c3f6ac0fb6ae6f8e820ee14b56744e (diff)
downloadnixlib-d8c13504316fc1466567454edab1122909f0fa48.tar
nixlib-d8c13504316fc1466567454edab1122909f0fa48.tar.gz
nixlib-d8c13504316fc1466567454edab1122909f0fa48.tar.bz2
nixlib-d8c13504316fc1466567454edab1122909f0fa48.tar.lz
nixlib-d8c13504316fc1466567454edab1122909f0fa48.tar.xz
nixlib-d8c13504316fc1466567454edab1122909f0fa48.tar.zst
nixlib-d8c13504316fc1466567454edab1122909f0fa48.zip
nixos/acme: fix chown hack
Diffstat (limited to 'nixpkgs')
-rw-r--r--nixpkgs/nixos/modules/security/acme.nix10
1 files changed, 5 insertions, 5 deletions
diff --git a/nixpkgs/nixos/modules/security/acme.nix b/nixpkgs/nixos/modules/security/acme.nix
index b0c9a7407786..06e5c0ede297 100644
--- a/nixpkgs/nixos/modules/security/acme.nix
+++ b/nixpkgs/nixos/modules/security/acme.nix
@@ -319,6 +319,11 @@ in
                   after = [ "network.target" "network-online.target" ];
                   wants = [ "network-online.target" ];
                   wantedBy = mkIf (!config.boot.isContainer) [ "multi-user.target" ];
+                  preStart = optionalString data.allowKeysForGroup ''
+                    exec find ${spath}/accounts \
+                        -type f \! -perm 640 -exec chmod 640 '{}' \; , \
+                        -type d \! -perm 750 -exec chmod 750 '{}' \;
+                  '';
                   serviceConfig = {
                     Type = "oneshot";
                     User = data.user;
@@ -329,11 +334,6 @@ in
                     WorkingDirectory = spath;
                     # Only try loading the credentialsFile if the dns challenge is enabled
                     EnvironmentFile = if data.dnsProvider != null then data.credentialsFile else null;
-                    preStart = if data.allowKeysForGroup then ''
-                      exec find ${spath}/accounts \
-                          -type f \! -perm 640 -exec chmod 640 '{}' \; , \
-                          -type d \! -perm 750 -exec chmod 750 '{}' \;
-                    '' else null;
                     ExecStart = pkgs.writeScript "acme-start" ''
                       #!${pkgs.runtimeShell} -e
                       test -L ${spath}/accounts -o -d ${spath}/accounts || ln -s ../accounts ${spath}/accounts