diff --git a/modules/sops/default.nix b/modules/sops/default.nix index 8a68ad10..26e567cc 100644 --- a/modules/sops/default.nix +++ b/modules/sops/default.nix @@ -333,7 +333,7 @@ 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.owner != "root" && secret.uid != null || secret.owner != "root" && secret.uid == null; + assertion = secret.owner != "root" -> secret.uid == null; message = "In ${secret.name} exactly one of sops.owner and sops.uid must be set"; } { assertion = secret.group == "" && secret.gid != null || secret.group != "" && secret.gid == null;