diff --git a/modules/sops/default.nix b/modules/sops/default.nix index 7625d37e..f4208761 100644 --- a/modules/sops/default.nix +++ b/modules/sops/default.nix @@ -81,7 +81,7 @@ let }; uid = lib.mkOption { type = lib.types.ints.unsigned; - default = users.users."root".uid; + default = 0; description = '' UID of the file, only applied when owner is null. The UID will be applied even if the corresponding user doesn't exist. ''; @@ -96,7 +96,7 @@ let }; gid = lib.mkOption { type = lib.types.ints.unsigned; - default = users.groups."root".gid; + default = 0; description = '' GID of the file, only applied when group is null. The GID will be applied even if the corresponding group doesn't exist. ''; @@ -333,10 +333,10 @@ in { (builtins.isString secret.sopsFile && lib.hasPrefix builtins.storeDir secret.sopsFile); message = "'${secret.sopsFile}' is not in the Nix store. Either add it to the Nix store or set sops.validateSopsFiles to false"; } { - assertion = secret.uid != users.users."root".uid -> secret.owner == null; + assertion = secret.uid != 0 -> secret.owner == null; message = "In ${secret.name} exactly one of sops.owner and sops.uid must be set"; } { - assertion = secret.gid != users.groups."root".gid -> secret.group == null; + assertion = secret.gid != 0 -> secret.group == null; message = "In ${secret.name} exactly one of sops.group and sops.gid must be set"; }]) cfg.secrets) );