1 { config, lib, pkgs, ... }:
3 cfg = config.services.irkerd;
7 options.services.irkerd = {
8 enable = lib.mkOption {
9 description = "Whether to enable irker, an IRC notification daemon.";
11 type = lib.types.bool;
14 openPorts = lib.mkOption {
15 description = "Open ports in the firewall for irkerd";
17 type = lib.types.bool;
20 listenAddress = lib.mkOption {
21 default = "localhost";
25 Specifies the bind address on which the irker daemon listens.
26 The default is localhost.
28 Irker authors strongly warn about the risks of running this on
29 a publicly accessible interface, so change this with caution.
36 description = "Nick to use for irker";
40 config = lib.mkIf cfg.enable {
41 systemd.services.irkerd = {
42 description = "Internet Relay Chat (IRC) notification daemon";
43 documentation = [ "man:irkerd(8)" "man:irkerhook(1)" "man:irk(1)" ];
44 after = [ "network.target" ];
45 wantedBy = [ "multi-user.target" ];
47 ExecStart = "${pkgs.irker}/bin/irkerd -H ${cfg.listenAddress} -n ${cfg.nick}";
52 environment.systemPackages = [ pkgs.irker ];
54 users.users.irkerd = {
55 description = "Irker daemon user";
59 users.groups.irkerd = {};
61 networking.firewall.allowedTCPPorts = lib.mkIf cfg.openPorts ports;
62 networking.firewall.allowedUDPPorts = lib.mkIf cfg.openPorts ports;