mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
nixos/services.bitlbee: remove with lib;
This commit is contained in:
parent
416649cbe6
commit
d9c47dac16
1 changed files with 29 additions and 32 deletions
|
@ -1,7 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.bitlbee;
|
||||
|
@ -46,8 +43,8 @@ in
|
|||
|
||||
services.bitlbee = {
|
||||
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to run the BitlBee IRC to other chat network gateway.
|
||||
|
@ -56,8 +53,8 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
interface = mkOption {
|
||||
type = types.str;
|
||||
interface = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "127.0.0.1";
|
||||
description = ''
|
||||
The interface the BitlBee daemon will be listening to. If `127.0.0.1`,
|
||||
|
@ -66,17 +63,17 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
portNumber = mkOption {
|
||||
portNumber = lib.mkOption {
|
||||
default = 6667;
|
||||
type = types.port;
|
||||
type = lib.types.port;
|
||||
description = ''
|
||||
Number of the port BitlBee will be listening to.
|
||||
'';
|
||||
};
|
||||
|
||||
authBackend = mkOption {
|
||||
authBackend = lib.mkOption {
|
||||
default = "storage";
|
||||
type = types.enum [ "storage" "pam" ];
|
||||
type = lib.types.enum [ "storage" "pam" ];
|
||||
description = ''
|
||||
How users are authenticated
|
||||
storage -- save passwords internally
|
||||
|
@ -84,9 +81,9 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
authMode = mkOption {
|
||||
authMode = lib.mkOption {
|
||||
default = "Open";
|
||||
type = types.enum [ "Open" "Closed" "Registered" ];
|
||||
type = lib.types.enum [ "Open" "Closed" "Registered" ];
|
||||
description = ''
|
||||
The following authentication modes are available:
|
||||
Open -- Accept connections from anyone, use NickServ for user authentication.
|
||||
|
@ -95,9 +92,9 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
hostName = mkOption {
|
||||
hostName = lib.mkOption {
|
||||
default = "";
|
||||
type = types.str;
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
Normally, BitlBee gets a hostname using getsockname(). If you have a nicer
|
||||
alias for your BitlBee daemon, you can set it here and BitlBee will identify
|
||||
|
@ -105,53 +102,53 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
plugins = mkOption {
|
||||
type = types.listOf types.package;
|
||||
plugins = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.package;
|
||||
default = [];
|
||||
example = literalExpression "[ pkgs.bitlbee-facebook ]";
|
||||
example = lib.literalExpression "[ pkgs.bitlbee-facebook ]";
|
||||
description = ''
|
||||
The list of bitlbee plugins to install.
|
||||
'';
|
||||
};
|
||||
|
||||
libpurple_plugins = mkOption {
|
||||
type = types.listOf types.package;
|
||||
libpurple_plugins = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.package;
|
||||
default = [];
|
||||
example = literalExpression "[ pkgs.purple-matrix ]";
|
||||
example = lib.literalExpression "[ pkgs.purple-matrix ]";
|
||||
description = ''
|
||||
The list of libpurple plugins to install.
|
||||
'';
|
||||
};
|
||||
|
||||
configDir = mkOption {
|
||||
configDir = lib.mkOption {
|
||||
default = "/var/lib/bitlbee";
|
||||
type = types.path;
|
||||
type = lib.types.path;
|
||||
description = ''
|
||||
Specify an alternative directory to store all the per-user configuration
|
||||
files.
|
||||
'';
|
||||
};
|
||||
|
||||
protocols = mkOption {
|
||||
protocols = lib.mkOption {
|
||||
default = "";
|
||||
type = types.str;
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
This option allows to remove the support of protocol, even if compiled
|
||||
in. If nothing is given, there are no restrictions.
|
||||
'';
|
||||
};
|
||||
|
||||
extraSettings = mkOption {
|
||||
extraSettings = lib.mkOption {
|
||||
default = "";
|
||||
type = types.lines;
|
||||
type = lib.types.lines;
|
||||
description = ''
|
||||
Will be inserted in the Settings section of the config file.
|
||||
'';
|
||||
};
|
||||
|
||||
extraDefaults = mkOption {
|
||||
extraDefaults = lib.mkOption {
|
||||
default = "";
|
||||
type = types.lines;
|
||||
type = lib.types.lines;
|
||||
description = ''
|
||||
Will be inserted in the Default section of the config file.
|
||||
'';
|
||||
|
@ -163,8 +160,8 @@ in
|
|||
|
||||
###### implementation
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf config.services.bitlbee.enable {
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf config.services.bitlbee.enable {
|
||||
systemd.services.bitlbee = {
|
||||
environment.PURPLE_PLUGIN_PATH = purple_plugin_path;
|
||||
description = "BitlBee IRC to other chat networks gateway";
|
||||
|
@ -182,7 +179,7 @@ in
|
|||
environment.systemPackages = [ bitlbeePkg ];
|
||||
|
||||
})
|
||||
(mkIf (config.services.bitlbee.authBackend == "pam") {
|
||||
(lib.mkIf (config.services.bitlbee.authBackend == "pam") {
|
||||
security.pam.services.bitlbee = {};
|
||||
})
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue