mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 23:23:07 +00:00
ef176dcf7e
conversions were done using https://github.com/pennae/nix-doc-munge using (probably) rev f34e145 running nix-doc-munge nixos/**/*.nix nix-doc-munge --import nixos/**/*.nix the tool ensures that only changes that could affect the generated manual *but don't* are committed, other changes require manual review and are discarded.
63 lines
1.3 KiB
Nix
63 lines
1.3 KiB
Nix
{ 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 (lib.mdDoc "the ngircd IRC server");
|
|
|
|
config = mkOption {
|
|
description = lib.mdDoc "The ngircd configuration (see ngircd.conf(5)).";
|
|
|
|
type = types.lines;
|
|
};
|
|
|
|
package = mkOption {
|
|
description = lib.mdDoc "The ngircd package.";
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.ngircd;
|
|
defaultText = literalExpression "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.users.ngircd = {
|
|
isSystemUser = true;
|
|
group = "ngircd";
|
|
description = "ngircd user.";
|
|
};
|
|
users.groups.ngircd = {};
|
|
|
|
};
|
|
}
|