diff --git a/system/ids.nix b/system/ids.nix index 73fa8c8a0bb1..b0ce6e28591e 100644 --- a/system/ids.nix +++ b/system/ids.nix @@ -24,6 +24,7 @@ haldaemon = 5; vsftpd = 7; ftp = 8; + bitlbee = 9; avahi = 10; portmap = 11; audio = 17; diff --git a/system/options.nix b/system/options.nix index f62bcd82d8db..f8d3e302e722 100644 --- a/system/options.nix +++ b/system/options.nix @@ -1042,7 +1042,7 @@ }; portNumber = mkOption { - default = "6667"; + default = 6667; description = '' Number of the port BitlBee will be listening to. ''; diff --git a/upstart-jobs/bitlbee.nix b/upstart-jobs/bitlbee.nix index b28d3d055612..d9956230aa07 100644 --- a/upstart-jobs/bitlbee.nix +++ b/upstart-jobs/bitlbee.nix @@ -1,17 +1,27 @@ args: with args; + +let + bitlbeeUid = (import ../system/ids.nix).uids.bitlbee; +in { name = "bitlbee"; users = [ { name = "bitlbee"; - uid = (import ../system/ids.nix).uids.bitlbee; + uid = bitlbeeUid; description = "BitlBee user"; home = "/var/empty"; } ]; - job = " -description \"BitlBee IRC to other chat networks gateway\" + groups = [ + { name = "bitlbee"; + gid = (import ../system/ids.nix).gids.bitlbee; + } + ]; + + job = '' +description "BitlBee IRC to other chat networks gateway" start on network-interfaces/started stop on network-interfaces/stop @@ -23,8 +33,8 @@ start script fi end script -# FIXME: Eventually we want to use inetd instead of using `-F'. -respawn ${bitlbee}/sbin/bitlbee -F -p ${portNumber} -i ${interface} - "; +respawn ${bitlbee}/sbin/bitlbee -F -p ${toString portNumber} \ + -i ${interface} -u bitlbee + ''; }