X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=flakes%2Fmyuids%2Fflake.nix;h=ff33651081fe44ee011316d279120887b444dfd6;hb=1a64deeb894dc95e2645a75771732c6cc53a79ad;hp=cc6dc665c106b5c99d0568d9f018c0435e3ea1f2;hpb=fa25ffd4583cc362075cd5e1b4130f33306103f0;p=perso%2FImmae%2FConfig%2FNix.git 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 @@ # 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; @@ -21,6 +22,7 @@ }; gids = { nagios = 11; # commented in the ids file + openldap = 99; # commented in the ids file cryptpad = 386; acme = 388; backup = 389; @@ -35,10 +37,20 @@ 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"; + } + ]; }; }; };