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 "the ngircd IRC server";
26 description = "The ngircd configuration (see ngircd.conf(5)).";
31 package = mkPackageOption pkgs "ngircd" { };
35 config = mkIf cfg.enable {
36 #!!! TODO: Use ExecReload (see https://github.com/NixOS/nixpkgs/issues/1988)
37 systemd.services.ngircd = {
38 description = "The ngircd IRC server";
40 wantedBy = [ "multi-user.target" ];
42 serviceConfig.ExecStart = "${cfg.package}/sbin/ngircd --config ${configFile} --nodaemon";
44 serviceConfig.User = "ngircd";
47 users.users.ngircd = {
50 description = "ngircd user.";
52 users.groups.ngircd = {};