0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

nixos/services.irkerd: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-24 22:05:45 +02:00
parent bd471d7eb1
commit a442c73bff

View file

@ -1,29 +1,26 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib;
let let
cfg = config.services.irkerd; cfg = config.services.irkerd;
ports = [ 6659 ]; ports = [ 6659 ];
in in
{ {
options.services.irkerd = { options.services.irkerd = {
enable = mkOption { enable = lib.mkOption {
description = "Whether to enable irker, an IRC notification daemon."; description = "Whether to enable irker, an IRC notification daemon.";
default = false; default = false;
type = types.bool; type = lib.types.bool;
}; };
openPorts = mkOption { openPorts = lib.mkOption {
description = "Open ports in the firewall for irkerd"; description = "Open ports in the firewall for irkerd";
default = false; default = false;
type = types.bool; type = lib.types.bool;
}; };
listenAddress = mkOption { listenAddress = lib.mkOption {
default = "localhost"; default = "localhost";
example = "0.0.0.0"; example = "0.0.0.0";
type = types.str; type = lib.types.str;
description = '' description = ''
Specifies the bind address on which the irker daemon listens. Specifies the bind address on which the irker daemon listens.
The default is localhost. The default is localhost.
@ -33,14 +30,14 @@ in
''; '';
}; };
nick = mkOption { nick = lib.mkOption {
default = "irker"; default = "irker";
type = types.str; type = lib.types.str;
description = "Nick to use for irker"; description = "Nick to use for irker";
}; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
systemd.services.irkerd = { systemd.services.irkerd = {
description = "Internet Relay Chat (IRC) notification daemon"; description = "Internet Relay Chat (IRC) notification daemon";
documentation = [ "man:irkerd(8)" "man:irkerhook(1)" "man:irk(1)" ]; documentation = [ "man:irkerd(8)" "man:irkerhook(1)" "man:irk(1)" ];
@ -61,7 +58,7 @@ in
}; };
users.groups.irkerd = {}; users.groups.irkerd = {};
networking.firewall.allowedTCPPorts = mkIf cfg.openPorts ports; networking.firewall.allowedTCPPorts = lib.mkIf cfg.openPorts ports;
networking.firewall.allowedUDPPorts = mkIf cfg.openPorts ports; networking.firewall.allowedUDPPorts = lib.mkIf cfg.openPorts ports;
}; };
} }