mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
6afb255d97
these changes were generated with nixq 0.0.2, by running nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix two mentions of the mdDoc function remain in nixos/, both of which are inside of comments. Since lib.mdDoc is already defined as just id, this commit is a no-op as far as Nix (and the built manual) is concerned.
55 lines
1.1 KiB
Nix
55 lines
1.1 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 "the ngircd IRC server";
|
|
|
|
config = mkOption {
|
|
description = "The ngircd configuration (see ngircd.conf(5)).";
|
|
|
|
type = types.lines;
|
|
};
|
|
|
|
package = mkPackageOption 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 = {};
|
|
|
|
};
|
|
}
|