Add ngircd module

wip/yesman
Shea Levy 10 years ago
parent 608f436da3
commit 78e6d0143d
  1. 1
      nixos/modules/misc/ids.nix
  2. 1
      nixos/modules/module-list.nix
  3. 58
      nixos/modules/services/networking/ngircd.nix

@ -120,6 +120,7 @@
jenkins = 109;
systemd-journal-gateway = 110;
notbit = 111;
ngircd = 112;
# When adding a uid, make sure it doesn't match an existing gid.

@ -180,6 +180,7 @@
./services/networking/minidlna.nix
./services/networking/nat.nix
./services/networking/networkmanager.nix
./services/networking/ngircd.nix
./services/networking/notbit.nix
./services/networking/ntopng.nix
./services/networking/ntpd.nix

@ -0,0 +1,58 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.ngircd;
configFile = pkgs.stdenv.mkDerivation {
name = "ngircd.conf";
text = cfg.config;
preferLocalBuild = true;
buildCommand = ''
echo -n "$text" > $out
${cfg.package}/sbin/ngircd --config $out --configtest
'';
};
in {
options = {
services.ngircd = {
enable = mkEnableOption "the ngircd IRC server";
config = mkOption {
description = "The ngircd configuration (see ngircd.conf(5)).";
type = types.lines;
};
package = mkOption {
description = "The ngircd package.";
type = types.package;
default = pkgs.ngircd;
};
};
};
config = mkIf cfg.enable {
#!!! TODO: Use ExecReload (see https://github.com/NixOS/nixpkgs/issues/1988)
systemd.services.ngircd = {
description = "The ngircd IRC server";
wantedBy = [ "multi-user.target" ];
serviceConfig.ExecStart = "${cfg.package}/sbin/ngircd --config ${configFile} --nodaemon";
serviceConfig.User = "ngircd";
};
users.extraUsers.ngircd = {
uid = config.ids.uids.ngircd;
description = "ngircd user.";
};
};
}
Loading…
Cancel
Save