mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-16 01:46:30 +00:00
43d6b17d87
they appear in the build log of the test). svn path=/nixos/trunk/; revision=20490
75 lines
1.4 KiB
Nix
75 lines
1.4 KiB
Nix
{ config, pkgs, ... }:
|
|
|
|
with pkgs.lib;
|
|
|
|
let
|
|
|
|
syslogConf = pkgs.writeText "syslog.conf" ''
|
|
kern.warning;*.err;authpriv.none /dev/${config.services.syslogd.tty}
|
|
|
|
# Send emergency messages to all users.
|
|
*.emerg *
|
|
|
|
# "local1" is used for dhcpd messages.
|
|
local1.* -/var/log/dhcpd
|
|
|
|
mail.* -/var/log/mail
|
|
|
|
*.=warning;*.=err -/var/log/warn
|
|
*.crit /var/log/warn
|
|
|
|
*.*;mail.none;local1.none -/var/log/messages
|
|
|
|
${config.services.syslogd.extraConfig}
|
|
'';
|
|
|
|
in
|
|
|
|
{
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.syslogd = {
|
|
|
|
tty = mkOption {
|
|
default = "tty10";
|
|
description = ''
|
|
The tty device on which syslogd will print important log
|
|
messages.
|
|
'';
|
|
};
|
|
|
|
extraConfig = mkOption {
|
|
default = "";
|
|
example = "news.* -/var/log/news";
|
|
description = ''
|
|
Additional text appended to <filename>syslog.conf</filename>.
|
|
'';
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
###### implementation
|
|
|
|
config = {
|
|
|
|
jobs.syslogd =
|
|
{ description = "Syslog daemon";
|
|
|
|
startOn = "started udev";
|
|
|
|
environment = { TZ = config.time.timeZone; };
|
|
|
|
daemonType = "fork";
|
|
|
|
exec = "${pkgs.sysklogd}/sbin/syslogd -f ${syslogConf}";
|
|
};
|
|
|
|
};
|
|
|
|
}
|