nixos/bitlbee: switched to systemd DynamicUser

This commit is contained in:
eyjhb 2021-09-30 09:54:49 +02:00
parent e3b5143614
commit f4c69e198c
No known key found for this signature in database
GPG key ID: 740FAE1502523BD8
2 changed files with 8 additions and 16 deletions

View file

@ -48,7 +48,7 @@ in
#disk = 6; # unused
#vsftpd = 7; # dynamically allocated ass of 2021-09-14
ftp = 8;
bitlbee = 9;
# bitlbee = 9; # removed 2021-10-05 #139765
#avahi = 10; # removed 2019-05-22
nagios = 11;
atd = 12;
@ -368,7 +368,7 @@ in
disk = 6;
#vsftpd = 7; # dynamically allocated as of 2021-09-14
ftp = 8;
bitlbee = 9;
# bitlbee = 9; # removed 2021-10-05 #139765
#avahi = 10; # removed 2019-05-22
#nagios = 11; # unused
atd = 12;

View file

@ -16,7 +16,6 @@ let
''
[settings]
RunMode = Daemon
User = bitlbee
ConfigDir = ${cfg.configDir}
DaemonInterface = ${cfg.interface}
DaemonPort = ${toString cfg.portNumber}
@ -166,24 +165,17 @@ in
config = mkMerge [
(mkIf config.services.bitlbee.enable {
users.users.bitlbee = {
uid = bitlbeeUid;
description = "BitlBee user";
home = "/var/lib/bitlbee";
createHome = true;
};
users.groups.bitlbee = {
gid = config.ids.gids.bitlbee;
};
systemd.services.bitlbee = {
environment.PURPLE_PLUGIN_PATH = purple_plugin_path;
description = "BitlBee IRC to other chat networks gateway";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig.User = "bitlbee";
serviceConfig.ExecStart = "${bitlbeePkg}/sbin/bitlbee -F -n -c ${bitlbeeConfig}";
serviceConfig = {
DynamicUser = true;
StateDirectory = "bitlbee";
ExecStart = "${bitlbeePkg}/sbin/bitlbee -F -n -c ${bitlbeeConfig}";
};
};
environment.systemPackages = [ bitlbeePkg ];