Skip to content

Commit

Permalink
Don't try assertions without help
Browse files Browse the repository at this point in the history
  • Loading branch information
dkowis committed Jan 18, 2025
1 parent 7e744b2 commit 2fc09be
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions modules/sops/templates/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -134,26 +134,4 @@ in
) config.sops.secrets;
}
);
### Adding Assertions outside `options`
### Assertions must be added to the top level of final config
assertions = lib.optionalAttrs (config ? sops.templates) (
lib.mapAttrsToList
(name: cfg: {
assertion = !(cfg.owner != null && cfg.uid != 0);
message = ''
Assertion failed for `sops.templates.${name}`:
Both `owner` and `uid` cannot be defined at the same time. Use either `owner` or leave `uid` as 0.
'';
})
config.sops.templates
++ lib.mapAttrsToList
(name: cfg: {
assertion = !(cfg.group != null && cfg.gid != 0);
message = ''
Assertion failed for `sops.templates.${name}`:
Both `group` and `gid` cannot be defined at the same time. Use either `group` or leave `gid` as 0.
'';
})
config.sops.templates
);
}

0 comments on commit 2fc09be

Please sign in to comment.