From 086a3931a295d2ba4faa98bfe717784c26829bfb Mon Sep 17 00:00:00 2001
From: Benedikt Peetz <benedikt.peetz@b-peetz.de>
Date: Sat, 29 Mar 2025 15:22:17 +0100
Subject: modules/constants: Correctly assign each uid so that none is greater
 400

The uid ranges from 400 upwards are reserved for things that allocate
them dynamic during runtime (like systemd). Our users would than get
clobbered, thus we avoid that range.

BREAKING CHANGE: Well, we'll need to change all uid of the files owned by the respective users.
---
 modules/by-name/co/constants/module.nix | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/modules/by-name/co/constants/module.nix b/modules/by-name/co/constants/module.nix
index 9919eb8..54e8d81 100644
--- a/modules/by-name/co/constants/module.nix
+++ b/modules/by-name/co/constants/module.nix
@@ -24,24 +24,25 @@
 
   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;
+      mastodon = 236;
+      virtualMail = 240;
       acme = 328;
       dhcpcd = 329;
       nscd = 330;
       sshd = 331;
       systemd-oom = 332;
       nix-sync = 334;
-      redis-peertube = 990;
-      peertube = 992; # TODO Sort correctly
-      mastodon = 996;
-      redis-mastodon = 991;
-      matrix-synapse = 224;
-      mautrix-whatsapp = 225;
-      knot-resolver = 997;
-      redis-rspamd = 989;
-      rspamd = 225;
-      opendkim = 221;
-      virtualMail = 5000;
-      etebase-server = 998;
 
       # As per the NixOS file, the uids should not be greater or equal to 400;
     };
-- 
cgit 1.4.1