2009-10-12 17:36:19 +01:00
|
|
|
{ config, pkgs, ... }:
|
2008-05-08 14:47:44 +01:00
|
|
|
|
2012-10-05 18:44:15 +01:00
|
|
|
with pkgs.lib;
|
2009-10-12 17:36:19 +01:00
|
|
|
|
2008-05-08 14:47:44 +01:00
|
|
|
{
|
2012-10-05 18:44:15 +01:00
|
|
|
###### interface
|
2008-05-08 14:47:44 +01:00
|
|
|
|
2012-10-05 18:44:15 +01:00
|
|
|
options = {
|
2009-10-12 17:36:19 +01:00
|
|
|
|
2012-10-05 18:44:15 +01:00
|
|
|
services.klogd.enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = versionOlder (getVersion config.boot.kernelPackages.kernel) "3.5";
|
|
|
|
description = ''
|
|
|
|
Whether to enable klogd, the kernel log message processing
|
|
|
|
daemon. Since systemd handles logging of kernel messages on
|
|
|
|
Linux 3.5 and later, this is only useful if you're running an
|
|
|
|
older kernel.
|
|
|
|
'';
|
|
|
|
};
|
2009-10-12 17:36:19 +01:00
|
|
|
|
2012-10-05 18:44:15 +01:00
|
|
|
};
|
2011-11-25 16:32:54 +00:00
|
|
|
|
2012-10-05 18:44:15 +01:00
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf config.services.klogd.enable {
|
|
|
|
|
|
|
|
jobs.klogd =
|
|
|
|
{ description = "Kernel Log Daemon";
|
|
|
|
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
|
|
|
path = [ pkgs.sysklogd ];
|
|
|
|
|
|
|
|
exec =
|
|
|
|
"klogd -c 1 -2 -n " +
|
|
|
|
"-k $(dirname $(readlink -f /run/booted-system/kernel))/System.map";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2008-05-08 14:47:44 +01:00
|
|
|
}
|