From 6b87772ca4a0b7d8448365b4f1c1a08a904fb3e8 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Fri, 30 Aug 2019 17:55:59 +0200 Subject: [PATCH] nixos/mailman: don't reserve a static uid in the system Any system uid will do, so we let the system allocate one for us. The 'mailman' group is gone entirely since we don't need it. Users who wish to run the 'mailman' administration utility can do so via 'sudo': $ sudo -u mailman mailman info Also, simplify the syntax of our user.users entry to rely on an attribute set rather than a list. --- nixos/modules/misc/ids.nix | 4 ++-- nixos/modules/services/mail/mailman.nix | 14 ++------------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index efd8544d6a21..ac6af1ce8b77 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -340,7 +340,7 @@ cockroachdb = 313; zoneminder = 314; paperless = 315; - mailman = 316; + #mailman = 316; # removed 2019-08-30 # When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399! @@ -641,7 +641,7 @@ cockroachdb = 313; zoneminder = 314; paperless = 315; - mailman = 316; + #mailman = 316; # removed 2019-08-30 # When adding a gid, make sure it doesn't match an existing # uid. Users and groups with the same name should have equal diff --git a/nixos/modules/services/mail/mailman.nix b/nixos/modules/services/mail/mailman.nix index cae59cb52cc0..f4d635139fa2 100644 --- a/nixos/modules/services/mail/mailman.nix +++ b/nixos/modules/services/mail/mailman.nix @@ -76,16 +76,7 @@ in { } ]; - users.users = singleton { - name = "mailman"; - group = "mailman"; - uid = config.ids.uids.mailman; - }; - - users.groups = singleton { - name = "mailman"; - gid = config.ids.gids.mailman; - }; + users.users.mailman = { description = "GNU Mailman"; isSystemUser = true; }; environment = { systemPackages = [ mailmanExe ]; @@ -105,10 +96,9 @@ in { ExecStart = "${mailmanExe}/bin/mailman start"; ExecStop = "${mailmanExe}/bin/mailman stop"; User = "mailman"; - Group = "mailman"; Type = "forking"; StateDirectory = "mailman"; - StateDirectoryMode = "0750"; + StateDirectoryMode = "0700"; RuntimeDirectory = "mailman"; PIDFile = "/run/mailman/master.pid"; };