From 7bcf564587e086b9d5c621e551d6195d952d973f Mon Sep 17 00:00:00 2001 From: Anders Papitto Date: Tue, 8 Sep 2015 12:05:48 -0700 Subject: [PATCH 1/3] bitlbee: patch to allow plugindir configuration --- .../networking/instant-messengers/bitlbee/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/instant-messengers/bitlbee/default.nix b/pkgs/applications/networking/instant-messengers/bitlbee/default.nix index ddaaa35da558..41a698be2907 100644 --- a/pkgs/applications/networking/instant-messengers/bitlbee/default.nix +++ b/pkgs/applications/networking/instant-messengers/bitlbee/default.nix @@ -1,4 +1,4 @@ -{ fetchurl, stdenv, gnutls, glib, pkgconfig, check, libotr, python }: +{ fetchurl, fetchpatch, stdenv, gnutls, glib, pkgconfig, check, libotr, python }: with stdenv.lib; stdenv.mkDerivation rec { @@ -12,12 +12,21 @@ stdenv.mkDerivation rec { buildInputs = [ gnutls glib pkgconfig libotr python ] ++ optional doCheck check; + patches = [(fetchpatch { + url = "https://github.com/bitlbee/bitlbee/commit/34d16d5b4b5265990125894572a90493284358cd.patch"; + sha256 = "05in9kxabb6s2c1l4b9ry58ppfciwmwzrkaq33df2zv0pr3z7w33"; + })]; + configureFlags = [ "--gcov=1" "--otr=1" "--ssl=gnutls" ]; + buildPhase = '' + make install-dev + ''; + doCheck = true; meta = { From 207f74eee976330e0d99c969aa729157fab6cb0b Mon Sep 17 00:00:00 2001 From: Anders Papitto Date: Tue, 8 Sep 2015 12:14:18 -0700 Subject: [PATCH 2/3] bitlbee-facebook: init at 2015-08-27 --- .../bitlbee-facebook/default.nix | 27 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 28 insertions(+) create mode 100644 pkgs/applications/networking/instant-messengers/bitlbee-facebook/default.nix diff --git a/pkgs/applications/networking/instant-messengers/bitlbee-facebook/default.nix b/pkgs/applications/networking/instant-messengers/bitlbee-facebook/default.nix new file mode 100644 index 000000000000..1427cc06ce42 --- /dev/null +++ b/pkgs/applications/networking/instant-messengers/bitlbee-facebook/default.nix @@ -0,0 +1,27 @@ +{ fetchurl, fetchFromGitHub, stdenv, bitlbee, autoconf, automake, libtool, pkgconfig, glib, json_glib }: + +with stdenv.lib; +stdenv.mkDerivation rec { + name = "bitlbee-facebook-2015-08-27"; + + src = fetchFromGitHub { + rev = "094a11b542e2cd8fac4f00fe01870ecd1cb4c062"; + owner = "jgeboski"; + repo = "bitlbee-facebook"; + sha256 = "1dvbl1z6fl3wswvqbs82vkqlggk24dyi8w7cmm5jh1fmaznmwqrl"; + }; + + buildInputs = [ bitlbee autoconf automake libtool pkgconfig glib json_glib ]; + + preConfigure = '' + export BITLBEE_PLUGINDIR=$out/lib/bitlbee + ./autogen.sh + ''; + + meta = { + description = "The Facebook protocol plugin for bitlbee"; + + homepage = https://github.com/jgeboski/bitlbee-facebook; + license = licenses.gpl2Plus; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 47bc0bb85b87..d6b79ca4d94b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10829,6 +10829,7 @@ let bibletime = callPackage ../applications/misc/bibletime { }; bitlbee = callPackage ../applications/networking/instant-messengers/bitlbee { }; + bitlbee-facebook = callPackage ../applications/networking/instant-messengers/bitlbee-facebook { }; bitmeter = callPackage ../applications/audio/bitmeter { }; From 78f7a09e3af902f5c20639c00d72ccd9dd56a55c Mon Sep 17 00:00:00 2001 From: Anders Papitto Date: Tue, 8 Sep 2015 12:15:41 -0700 Subject: [PATCH 3/3] bitlbee service: enable plugins --- nixos/modules/services/networking/bitlbee.nix | 20 ++++++++++++++----- .../instant-messengers/bitlbee/plugins.nix | 20 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 pkgs/applications/networking/instant-messengers/bitlbee/plugins.nix diff --git a/nixos/modules/services/networking/bitlbee.nix b/nixos/modules/services/networking/bitlbee.nix index 27b7dd71d9e5..5e6847097a94 100644 --- a/nixos/modules/services/networking/bitlbee.nix +++ b/nixos/modules/services/networking/bitlbee.nix @@ -16,11 +16,12 @@ let '' [settings] RunMode = Daemon - User = bitlbee + User = bitlbee ConfigDir = ${cfg.configDir} DaemonInterface = ${cfg.interface} DaemonPort = ${toString cfg.portNumber} AuthMode = ${cfg.authMode} + Plugindir = ${pkgs.bitlbee-plugins cfg.plugins}/lib/bitlbee ${lib.optionalString (cfg.hostName != "") "HostName = ${cfg.hostName}"} ${lib.optionalString (cfg.protocols != "") "Protocols = ${cfg.protocols}"} ${cfg.extraSettings} @@ -72,7 +73,7 @@ in Open -- Accept connections from anyone, use NickServ for user authentication. Closed -- Require authorization (using the PASS command during login) before allowing the user to connect at all. Registered -- Only allow registered users to use this server; this disables the register- and the account command until the user identifies himself. - ''; + ''; }; hostName = mkOption { @@ -85,6 +86,15 @@ in ''; }; + plugins = mkOption { + type = types.listOf types.package; + default = []; + example = literalExample "[ pkgs.bitlbee-facebook ]"; + description = '' + The list of bitlbee plugins to install. + ''; + }; + configDir = mkOption { default = "/var/lib/bitlbee"; type = types.path; @@ -107,14 +117,14 @@ in default = ""; description = '' Will be inserted in the Settings section of the config file. - ''; + ''; }; extraDefaults = mkOption { default = ""; description = '' Will be inserted in the Default section of the config file. - ''; + ''; }; }; @@ -138,7 +148,7 @@ in gid = config.ids.gids.bitlbee; }; - systemd.services.bitlbee = + systemd.services.bitlbee = { description = "BitlBee IRC to other chat networks gateway"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; diff --git a/pkgs/applications/networking/instant-messengers/bitlbee/plugins.nix b/pkgs/applications/networking/instant-messengers/bitlbee/plugins.nix new file mode 100644 index 000000000000..4e05e7cae970 --- /dev/null +++ b/pkgs/applications/networking/instant-messengers/bitlbee/plugins.nix @@ -0,0 +1,20 @@ +{ stdenv, bitlbee }: + +with stdenv.lib; + +plugins: + +stdenv.mkDerivation { + inherit bitlbee plugins; + name = "bitlbee-plugins"; + buildInputs = [ bitlbee plugins ]; + phases = [ "installPhase" ]; + installPhase = '' + mkdir -p $out/lib/bitlbee + for plugin in $plugins; do + for thing in $(ls $plugin/lib/bitlbee); do + ln -s $plugin/lib/bitlbee/$thing $out/lib/bitlbee/ + done + done + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d6b79ca4d94b..f057d3f4a41c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10829,6 +10829,8 @@ let bibletime = callPackage ../applications/misc/bibletime { }; bitlbee = callPackage ../applications/networking/instant-messengers/bitlbee { }; + bitlbee-plugins = callPackage ../applications/networking/instant-messengers/bitlbee/plugins.nix { }; + bitlbee-facebook = callPackage ../applications/networking/instant-messengers/bitlbee-facebook { }; bitmeter = callPackage ../applications/audio/bitmeter { };