forked from dan/liminix
extract log persistence config from s6 to new module
because it frobs kernel config, it breaks levitate as levitate evalModules doesn't include the kernel
This commit is contained in:
parent
ea5370b3f4
commit
74027b44d7
@ -33,6 +33,7 @@ let
|
||||
./modules/busybox.nix
|
||||
./modules/hostname.nix
|
||||
./modules/kernel
|
||||
./modules/logging.nix
|
||||
./modules/klogd.nix
|
||||
device.module
|
||||
liminix-config
|
||||
|
19
modules/logging.nix
Normal file
19
modules/logging.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption mkOption types;
|
||||
in {
|
||||
options = {
|
||||
logging = {
|
||||
persistent = {
|
||||
enable = mkEnableOption "store logs across reboots";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = {
|
||||
kernel.config = mkIf config.logging.persistent.enable {
|
||||
PSTORE = "y";
|
||||
PSTORE_PMSG = "y";
|
||||
PSTORE_RAM = "y";
|
||||
};
|
||||
};
|
||||
}
|
@ -17,7 +17,7 @@ let
|
||||
logger =
|
||||
let pipecmds =
|
||||
["${s6}/bin/s6-log -bpd3 -- ${cfg.script} 1"] ++
|
||||
(lib.optional cfg.persistent.enable
|
||||
(lib.optional (cfg ? persistent && cfg.persistent.enable)
|
||||
"/bin/tee /dev/pmsg0") ++
|
||||
(lib.optional cfg.shipping.enable
|
||||
"${pkgs.logshipper}/bin/logtap ${cfg.shipping.socket} logshipper-socket-event");
|
||||
@ -215,9 +215,6 @@ let
|
||||
in {
|
||||
options = {
|
||||
logging = {
|
||||
persistent = {
|
||||
enable = mkEnableOption "store logs across reboots";
|
||||
};
|
||||
shipping = {
|
||||
enable = mkEnableOption "unix socket for log shipping";
|
||||
socket = mkOption {
|
||||
@ -269,11 +266,6 @@ in {
|
||||
)];
|
||||
|
||||
config = {
|
||||
kernel.config = mkIf config.logging.persistent.enable {
|
||||
PSTORE = "y";
|
||||
PSTORE_PMSG = "y";
|
||||
PSTORE_RAM = "y";
|
||||
};
|
||||
filesystem = dir {
|
||||
etc = dir {
|
||||
s6-rc = dir {
|
||||
|
Loading…
Reference in New Issue
Block a user