diff options
Diffstat (limited to 'flakes/myuids/flake.nix')
-rw-r--r-- | flakes/myuids/flake.nix | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/flakes/myuids/flake.nix b/flakes/myuids/flake.nix index cc6dc66..ff33651 100644 --- a/flakes/myuids/flake.nix +++ b/flakes/myuids/flake.nix | |||
@@ -6,6 +6,7 @@ | |||
6 | # Check that there is no clash with nixos/modules/misc/ids.nix | 6 | # Check that there is no clash with nixos/modules/misc/ids.nix |
7 | uids = { | 7 | uids = { |
8 | cryptpad = 386; | 8 | cryptpad = 386; |
9 | openldap = 99; # commented in the ids file | ||
9 | postfixscripts = 387; | 10 | postfixscripts = 387; |
10 | acme = 388; | 11 | acme = 388; |
11 | backup = 389; | 12 | backup = 389; |
@@ -21,6 +22,7 @@ | |||
21 | }; | 22 | }; |
22 | gids = { | 23 | gids = { |
23 | nagios = 11; # commented in the ids file | 24 | nagios = 11; # commented in the ids file |
25 | openldap = 99; # commented in the ids file | ||
24 | cryptpad = 386; | 26 | cryptpad = 386; |
25 | acme = 388; | 27 | acme = 388; |
26 | backup = 389; | 28 | backup = 389; |
@@ -35,10 +37,20 @@ | |||
35 | mastodon = 399; | 37 | mastodon = 399; |
36 | }; | 38 | }; |
37 | }; | 39 | }; |
38 | nixosModule = { ... }: { | 40 | nixosModule = { config, lib, ... }: { |
39 | config = { | 41 | config = { |
40 | ids.uids = self.lib.uids; | 42 | ids.uids = self.lib.uids; |
41 | ids.gids = self.lib.gids; | 43 | ids.gids = self.lib.gids; |
44 | assertions = [ | ||
45 | { | ||
46 | assertion = builtins.length (builtins.attrValues config.ids.gids) == builtins.length (lib.unique (builtins.attrValues config.ids.gids)); | ||
47 | message = "Non-unique list of gids"; | ||
48 | } | ||
49 | { | ||
50 | assertion = builtins.length (builtins.attrValues config.ids.uids) == builtins.length (lib.unique (builtins.attrValues config.ids.uids)); | ||
51 | message = "Non-unique list of uids"; | ||
52 | } | ||
53 | ]; | ||
42 | }; | 54 | }; |
43 | }; | 55 | }; |
44 | }; | 56 | }; |