nixos/nntp-proxy: define group, fix after #133166

This commit is contained in:
Guillaume Girol 2021-09-17 12:00:00 +00:00 committed by Yuka
parent fa3664a176
commit af5ba65b9f
2 changed files with 8 additions and 8 deletions

View file

@ -262,7 +262,7 @@ in
pdnsd = 229; pdnsd = 229;
octoprint = 230; octoprint = 230;
avahi-autoipd = 231; avahi-autoipd = 231;
nntp-proxy = 232; # nntp-proxy = 232; #dynamically allocated as of 2021-09-17
mjpg-streamer = 233; mjpg-streamer = 233;
#radicale = 234;# dynamically allocated as of 2021-09-03 #radicale = 234;# dynamically allocated as of 2021-09-03
hydra-queue-runner = 235; hydra-queue-runner = 235;

View file

@ -6,8 +6,6 @@ let
inherit (pkgs) nntp-proxy; inherit (pkgs) nntp-proxy;
proxyUser = "nntp-proxy";
cfg = config.services.nntp-proxy; cfg = config.services.nntp-proxy;
configBool = b: if b then "TRUE" else "FALSE"; configBool = b: if b then "TRUE" else "FALSE";
@ -210,16 +208,18 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
users.users.${proxyUser} = users.users.nntp-proxy = {
{ uid = config.ids.uids.nntp-proxy; isSystemUser = true;
description = "NNTP-Proxy daemon user"; group = "nntp-proxy";
}; description = "NNTP-Proxy daemon user";
};
users.groups.nntp-proxy = {};
systemd.services.nntp-proxy = { systemd.services.nntp-proxy = {
description = "NNTP proxy"; description = "NNTP proxy";
after = [ "network.target" "nss-lookup.target" ]; after = [ "network.target" "nss-lookup.target" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = { User="${proxyUser}"; }; serviceConfig = { User="nntp-proxy"; };
serviceConfig.ExecStart = "${nntp-proxy}/bin/nntp-proxy ${confFile}"; serviceConfig.ExecStart = "${nntp-proxy}/bin/nntp-proxy ${confFile}";
preStart = '' preStart = ''
if [ ! \( -f ${cfg.sslCert} -a -f ${cfg.sslKey} \) ]; then if [ ! \( -f ${cfg.sslCert} -a -f ${cfg.sslKey} \) ]; then