diff --git a/nixos/modules/misc/crashdump.nix b/nixos/modules/misc/crashdump.nix index b0f75d9caaa3..d67a4aa412ce 100644 --- a/nixos/modules/misc/crashdump.nix +++ b/nixos/modules/misc/crashdump.nix @@ -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...";