about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/secrets/default.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/secrets/default.nix b/modules/secrets/default.nix
index d4a2fd8..2d8998a 100644
--- a/modules/secrets/default.nix
+++ b/modules/secrets/default.nix
@@ -15,7 +15,8 @@ in
         userExists = u: builtins.hasAttr u config.users.users;
         groupExists = g: builtins.hasAttr g config.users.groups;
 
-        # Only set the user and/or group if they exist, to avoid warnings
+        # Only set the user and/or group if they exist, to avoid
+        # warnings. If they don't exist, we default to root.
         userIfExists = u: if userExists u then u else "root";
         groupIfExists = g: if groupExists g then g else "root";
 
@@ -25,7 +26,7 @@ in
           } // lib.optionalAttrs (attrs ? owner) {
             owner = lib.mkDefault (userIfExists attrs.owner);
           } // lib.optionalAttrs (attrs ? group) {
-            group = lib.mkDefault (groupExists attrs.group);
+            group = lib.mkDefault (groupIfExists attrs.group);
           } // lib.optionalAttrs (attrs ? mode) {
             inherit (attrs) mode;
           } // lib.optionalAttrs (attrs ? path) {