about summary refs log tree commit diff stats
path: root/modules/by-name/co/constants/module.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/by-name/co/constants/module.nix60
1 files changed, 50 insertions, 10 deletions
diff --git a/modules/by-name/co/constants/module.nix b/modules/by-name/co/constants/module.nix
index a28ea0c..d601e70 100644
--- a/modules/by-name/co/constants/module.nix
+++ b/modules/by-name/co/constants/module.nix
@@ -1,41 +1,81 @@
 # This file is inspired by the `nixos/modules/misc/ids.nix`
 # file in nixpkgs.
-{lib, ...}: {
+{
+  lib,
+  config,
+  ...
+}: {
   options.vhack.constants = {
     ids.uids = lib.mkOption {
       internal = true;
       description = ''
         The user IDs used in the vhack.eu nixos config.
       '';
-      type = lib.types.attrsOf lib.types.int;
+      type = lib.types.attrsOf (lib.types.ints.between 0 400);
     };
     ids.gids = lib.mkOption {
       internal = true;
       description = ''
         The group IDs used in the vhack.eu nixos config.
       '';
-      type = lib.types.attrsOf lib.types.int;
+      type = lib.types.attrsOf (lib.types.ints.between 0 400);
     };
   };
 
   config.vhack.constants = {
     ids.uids = {
+      # Keep this sorted with `!sort --numeric-sort --key=2 --field-separator="="`
+      opendkim = 221;
+      mautrix-whatsapp = 222;
+      etebase-server = 223;
+      matrix-synapse = 224;
+      rspamd = 225;
+      knot-resolver = 226;
+      peertube = 231;
+      redis-mastodon = 232;
+      redis-peertube = 233;
+      redis-rspamd = 234;
+      redis-stalwart-mail = 235;
+      mastodon = 236;
+      stalwart-mail = 238;
       acme = 328;
       dhcpcd = 329;
       nscd = 330;
       sshd = 331;
       systemd-oom = 332;
+      nix-sync = 334;
 
       # As per the NixOS file, the uids should not be greater or equal to 400;
     };
-    ids.gids = {
-      acme = 328;
-      dhcpcd = 329;
-      nscd = 330;
-      sshd = 331;
-      systemd-oom = 332;
-      resolvconf = 333; # This group is not matched to an user?
+    ids.gids = let
+      inherit (config.vhack.constants.ids) uids;
+    in {
+      inherit
+        (uids)
+        acme
+        dhcpcd
+        etebase-server
+        knot-resolver
+        mastodon
+        matrix-synapse
+        mautrix-whatsapp
+        nix-sync
+        nscd
+        opendkim
+        peertube
+        redis-mastodon
+        redis-peertube
+        redis-rspamd
+        redis-stalwart-mail
+        rspamd
+        sshd
+        stalwart-mail
+        systemd-oom
+        ;
+
+      # Keep this sorted with `!sort --numeric-sort --key=2 --field-separator="="`
       systemd-coredump = 151; # matches systemd-coredump user
+      resolvconf = 333; # This group is not matched to an user?
 
       # The gid should match the uid. Thus should not be >= 400;
     };