1 { config, lib, pkgs, ... }:
6 cfg = config.services.irkerd;
10 options.services.irkerd = {
12 description = lib.mdDoc "Whether to enable irker, an IRC notification daemon.";
17 openPorts = mkOption {
18 description = lib.mdDoc "Open ports in the firewall for irkerd";
23 listenAddress = mkOption {
24 default = "localhost";
27 description = lib.mdDoc ''
28 Specifies the bind address on which the irker daemon listens.
29 The default is localhost.
31 Irker authors strongly warn about the risks of running this on
32 a publicly accessible interface, so change this with caution.
39 description = lib.mdDoc "Nick to use for irker";
43 config = mkIf cfg.enable {
44 systemd.services.irkerd = {
45 description = "Internet Relay Chat (IRC) notification daemon";
46 documentation = [ "man:irkerd(8)" "man:irkerhook(1)" "man:irk(1)" ];
47 after = [ "network.target" ];
48 wantedBy = [ "multi-user.target" ];
50 ExecStart = "${pkgs.irker}/bin/irkerd -H ${cfg.listenAddress} -n ${cfg.nick}";
55 environment.systemPackages = [ pkgs.irker ];
57 users.users.irkerd = {
58 description = "Irker daemon user";
62 users.groups.irkerd = {};
64 networking.firewall.allowedTCPPorts = mkIf cfg.openPorts ports;
65 networking.firewall.allowedUDPPorts = mkIf cfg.openPorts ports;