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.
This commit is contained in:
Peter Simons 2019-08-30 17:55:59 +02:00
parent da456aff25
commit 6b87772ca4
2 changed files with 4 additions and 14 deletions

View file

@ -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

View file

@ -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";
};