lol

bitlbee service: Add option to load libpurple plugins into bitlbee

+24 -3
+24 -3
nixos/modules/services/networking/bitlbee.nix
··· 7 cfg = config.services.bitlbee; 8 bitlbeeUid = config.ids.uids.bitlbee; 9 10 bitlbeeConfig = pkgs.writeText "bitlbee.conf" 11 '' 12 [settings] ··· 24 [defaults] 25 ${cfg.extraDefaults} 26 ''; 27 28 in 29 ··· 90 ''; 91 }; 92 93 configDir = mkOption { 94 default = "/var/lib/bitlbee"; 95 type = types.path; ··· 144 }; 145 146 systemd.services.bitlbee = 147 - { description = "BitlBee IRC to other chat networks gateway"; 148 after = [ "network.target" ]; 149 wantedBy = [ "multi-user.target" ]; 150 serviceConfig.User = "bitlbee"; 151 - serviceConfig.ExecStart = "${pkgs.bitlbee}/sbin/bitlbee -F -n -c ${bitlbeeConfig}"; 152 }; 153 154 - environment.systemPackages = [ pkgs.bitlbee ]; 155 156 }; 157
··· 7 cfg = config.services.bitlbee; 8 bitlbeeUid = config.ids.uids.bitlbee; 9 10 + bitlbeePkg = if cfg.libpurple_plugins == [] 11 + then pkgs.bitlbee 12 + else pkgs.bitlbee.override { enableLibPurple = true; }; 13 + 14 bitlbeeConfig = pkgs.writeText "bitlbee.conf" 15 '' 16 [settings] ··· 28 [defaults] 29 ${cfg.extraDefaults} 30 ''; 31 + 32 + purple_plugin_path = 33 + lib.concatMapStringsSep ":" 34 + (plugin: "${plugin}/lib/pidgin/") 35 + cfg.libpurple_plugins 36 + ; 37 38 in 39 ··· 100 ''; 101 }; 102 103 + libpurple_plugins = mkOption { 104 + type = types.listOf types.package; 105 + default = []; 106 + example = literalExample "[ pkgs.purple-matrix ]"; 107 + description = '' 108 + The list of libpurple plugins to install. 109 + ''; 110 + }; 111 + 112 configDir = mkOption { 113 default = "/var/lib/bitlbee"; 114 type = types.path; ··· 163 }; 164 165 systemd.services.bitlbee = 166 + { 167 + environment.PURPLE_PLUGIN_PATH = purple_plugin_path; 168 + description = "BitlBee IRC to other chat networks gateway"; 169 after = [ "network.target" ]; 170 wantedBy = [ "multi-user.target" ]; 171 serviceConfig.User = "bitlbee"; 172 + serviceConfig.ExecStart = "${bitlbeePkg}/sbin/bitlbee -F -n -c ${bitlbeeConfig}"; 173 }; 174 175 + environment.systemPackages = [ bitlbeePkg ]; 176 177 }; 178