1 { config, lib, pkgs, ... }:
6 cfg = config.services.ngircd;
8 configFile = pkgs.stdenv.mkDerivation {
13 preferLocalBuild = true;
16 echo -n "$text" > $out
17 ${cfg.package}/sbin/ngircd --config $out --configtest
23 enable = mkEnableOption (lib.mdDoc "the ngircd IRC server");
26 description = lib.mdDoc "The ngircd configuration (see ngircd.conf(5)).";
32 description = lib.mdDoc "The ngircd package.";
36 default = pkgs.ngircd;
37 defaultText = literalExpression "pkgs.ngircd";
42 config = mkIf cfg.enable {
43 #!!! TODO: Use ExecReload (see https://github.com/NixOS/nixpkgs/issues/1988)
44 systemd.services.ngircd = {
45 description = "The ngircd IRC server";
47 wantedBy = [ "multi-user.target" ];
49 serviceConfig.ExecStart = "${cfg.package}/sbin/ngircd --config ${configFile} --nodaemon";
51 serviceConfig.User = "ngircd";
54 users.users.ngircd = {
57 description = "ngircd user.";
59 users.groups.ngircd = {};