X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=flakes%2Fmyuids%2Fflake.nix;h=ff33651081fe44ee011316d279120887b444dfd6;hb=1a64deeb894dc95e2645a75771732c6cc53a79ad;hp=4068ba3e67ae72805eb7506cd5a41b8d8e5308e1;hpb=31d99b750fca57c660f98e23e12053eaf42d4929;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/flakes/myuids/flake.nix b/flakes/myuids/flake.nix index 4068ba3..ff33651 100644 --- a/flakes/myuids/flake.nix +++ b/flakes/myuids/flake.nix @@ -5,6 +5,8 @@ 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; @@ -20,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; @@ -33,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"; + } + ]; }; }; };