summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2019-04-18 11:13:31 +0200
committerlassulus <lassulus@lassul.us>2019-04-18 11:13:31 +0200
commitcd6c5e1311cd14f232faa43f0913f6158f7d780b (patch)
tree58a4b2e52bd7bf0052a19d05df489c08bc6108ed /krebs
parent18a51d89bf2adb155306032970089591ef55a103 (diff)
parent1bbd53c4599fd1148bdb864f981b6fd4563fb476 (diff)
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'krebs')
-rw-r--r--krebs/3modules/permown.nix10
1 files changed, 6 insertions, 4 deletions
diff --git a/krebs/3modules/permown.nix b/krebs/3modules/permown.nix
index a3b49b303..0f2ba86c8 100644
--- a/krebs/3modules/permown.nix
+++ b/krebs/3modules/permown.nix
@@ -35,7 +35,7 @@ with import <stockholm/lib>;
config = let
plans = attrValues config.krebs.permown;
- in mkIf (plans != {}) {
+ in mkIf (plans != []) {
system.activationScripts.permown = let
mkdir = plan: /* sh */ ''
@@ -61,7 +61,7 @@ with import <stockholm/lib>;
ExecStart = pkgs.writeDash "permown" ''
set -efu
- find "$ROOT_PATH" -exec chown "$OWNER_GROUP" {} +
+ find "$ROOT_PATH" -exec chown -h "$OWNER_GROUP" {} +
find "$ROOT_PATH" -type d -exec chmod "$DIR_MODE" {} +
find "$ROOT_PATH" -type f -exec chmod "$FILE_MODE" {} +
@@ -70,8 +70,10 @@ with import <stockholm/lib>;
if test -d "$path"; then
exec "$0" "$@"
fi
- chown "$OWNER_GROUP" "$path"
- chmod "$FILE_MODE" "$path"
+ chown -h "$OWNER_GROUP" "$path"
+ if test -f "$path"; then
+ chmod "$FILE_MODE" "$path"
+ fi
done
'';
Restart = "always";