]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - flakes/myuids/flake.nix
Squash changes containing private information
[perso/Immae/Config/Nix.git] / flakes / myuids / flake.nix
index 1a3a9b45ea681865c4967d691d77f8810b2ab858..ff33651081fe44ee011316d279120887b444dfd6 100644 (file)
@@ -5,6 +5,9 @@
     lib = {
       # Check that there is no clash with nixos/modules/misc/ids.nix
       uids = {
+        cryptpad = 386;
+        openldap = 99; # commented in the ids file
+        postfixscripts = 387;
         acme = 388;
         backup = 389;
         vhost = 390;
@@ -19,6 +22,8 @@
       };
       gids = {
         nagios = 11; # commented in the ids file
+        openldap = 99; # commented in the ids file
+        cryptpad = 386;
         acme = 388;
         backup = 389;
         vhost = 390;
         mastodon = 399;
       };
     };
-    nixosModule = { ... }: {
+    nixosModule = { config, lib, ... }: {
       config = {
         ids.uids = self.lib.uids;
         ids.gids = self.lib.gids;
+        assertions = [
+          {
+            assertion = builtins.length (builtins.attrValues config.ids.gids) == builtins.length (lib.unique (builtins.attrValues config.ids.gids));
+            message = "Non-unique list of gids";
+          }
+          {
+            assertion = builtins.length (builtins.attrValues config.ids.uids) == builtins.length (lib.unique (builtins.attrValues config.ids.uids));
+            message = "Non-unique list of uids";
+          }
+        ];
       };
     };
   };