From f4c69e198ce8a8208995e43133d4c32d2045a587 Mon Sep 17 00:00:00 2001 From: eyjhb Date: Thu, 30 Sep 2021 09:54:49 +0200 Subject: [PATCH] nixos/bitlbee: switched to systemd DynamicUser --- nixos/modules/misc/ids.nix | 4 ++-- nixos/modules/services/networking/bitlbee.nix | 20 ++++++------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index e760a18f5082..b77ef42a1657 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -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; diff --git a/nixos/modules/services/networking/bitlbee.nix b/nixos/modules/services/networking/bitlbee.nix index 59ad9e546863..f545852453ef 100644 --- a/nixos/modules/services/networking/bitlbee.nix +++ b/nixos/modules/services/networking/bitlbee.nix @@ -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 ];