diff --git a/system/ids.nix b/system/ids.nix index fd6ff9f6a15b..b83f9a531c5b 100644 --- a/system/ids.nix +++ b/system/ids.nix @@ -10,6 +10,7 @@ nagios = 6; vsftpd = 7; ftp = 8; + bitlbee = 9; nixbld = 30000; # start of range of uids nobody = 65534; }; diff --git a/system/options.nix b/system/options.nix index 71cb1a4e305d..7ee54f955c23 100644 --- a/system/options.nix +++ b/system/options.nix @@ -807,6 +807,34 @@ }; + bitlbee = { + + enable = mkOption { + default = false; + description = '' + Whether the run the BitlBee IRC to other chat network gateway. + Running it allows you to access the MSN, Jabber, Yahoo! and ICQ chat + networks via an IRC client. + ''; + }; + + interface = mkOption { + default = "127.0.0.1"; + description = '' + The interface the BitlBee deamon will be listening to. If `127.0.0.1', + only clients on the local host can connect to it; if `0.0.0.0', clients + can access it from any network interface. + ''; + }; + + portNumber = mkOption { + default = "6667"; + description = '' + Number of the port BitlBee will be listening to. + ''; + }; + + }; xserver = { diff --git a/upstart-jobs/bitlbee.nix b/upstart-jobs/bitlbee.nix new file mode 100644 index 000000000000..dca737d3a0b6 --- /dev/null +++ b/upstart-jobs/bitlbee.nix @@ -0,0 +1,30 @@ +args: with args; +{ + name = "bitlbee"; + + users = [ + { name = "bitlbee"; + uid = (import ../system/ids.nix).uids.bitlbee; + description = "BitlBee user"; + home = "/var/empty"; + } + ]; + + job = " +description \"BitlBee IRC to other chat networks gateway\" + +start on network-interfaces/started +stop on network-interfaces/stop + +start script + if ! test -d /var/lib/bitlbee + then + mkdir -p /var/lib/bitlbee + fi +end script + +# FIXME: Eventually we want to use inetd instead of using `-D'. +respawn ${bitlbee}/sbin/bitlbee -D -p ${portNumber} -i ${interface} + "; + +} diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 7731b5d67525..161e1b90ab44 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -236,6 +236,12 @@ let inherit config pkgs; }) + ++ optional config.services.bitlbee.enable + (import ../upstart-jobs/bitlbee.nix { + inherit (pkgs) bitlbee; + inherit (config.services.bitlbee) portNumber interface; + }) + # ALSA sound support. ++ optional config.sound.enable (import ../upstart-jobs/alsa.nix {