nixos/crashdump: remove with lib;
This commit is contained in:
parent
650b7695e0
commit
4feff6c9b5
@ -1,11 +1,8 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
crashdump = config.boot.crashDump;
|
||||
|
||||
kernelParams = concatStringsSep " " crashdump.kernelParams;
|
||||
kernelParams = lib.concatStringsSep " " crashdump.kernelParams;
|
||||
|
||||
in
|
||||
###### interface
|
||||
@ -13,8 +10,8 @@ in
|
||||
options = {
|
||||
boot = {
|
||||
crashDump = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
If enabled, NixOS will set up a kernel that will
|
||||
@ -24,17 +21,17 @@ in
|
||||
It also activates the NMI watchdog.
|
||||
'';
|
||||
};
|
||||
reservedMemory = mkOption {
|
||||
reservedMemory = lib.mkOption {
|
||||
default = "128M";
|
||||
type = types.str;
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
The amount of memory reserved for the crashdump kernel.
|
||||
If you choose a too high value, dmesg will mention
|
||||
"crashkernel reservation failed".
|
||||
'';
|
||||
};
|
||||
kernelParams = mkOption {
|
||||
type = types.listOf types.str;
|
||||
kernelParams = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ "1" "boot.shell_on_fail" ];
|
||||
description = ''
|
||||
Parameters that will be passed to the kernel kexec-ed on crash.
|
||||
@ -46,7 +43,7 @@ in
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf crashdump.enable {
|
||||
config = lib.mkIf crashdump.enable {
|
||||
boot = {
|
||||
postBootCommands = ''
|
||||
echo "loading crashdump kernel...";
|
||||
|
Loading…
Reference in New Issue
Block a user