diff --git a/nixos/modules/system/boot/systemd/coredump.nix b/nixos/modules/system/boot/systemd/coredump.nix index 18211b960809..c70e0004ca25 100644 --- a/nixos/modules/system/boot/systemd/coredump.nix +++ b/nixos/modules/system/boot/systemd/coredump.nix @@ -6,17 +6,15 @@ ... }: -with lib; - let cfg = config.systemd.coredump; systemd = config.systemd.package; in { options = { - systemd.coredump.enable = mkOption { + systemd.coredump.enable = lib.mkOption { default = true; - type = types.bool; + type = lib.types.bool; description = '' Whether core dumps should be processed by {command}`systemd-coredump`. If disabled, core dumps @@ -24,9 +22,9 @@ in ''; }; - systemd.coredump.extraConfig = mkOption { + systemd.coredump.extraConfig = lib.mkOption { default = ""; - type = types.lines; + type = lib.types.lines; example = "Storage=journal"; description = '' Extra config options for systemd-coredump. See {manpage}`coredump.conf(5)` man page @@ -35,9 +33,9 @@ in }; }; - config = mkMerge [ + config = lib.mkMerge [ - (mkIf cfg.enable { + (lib.mkIf cfg.enable { systemd.additionalUpstreamSystemUnits = [ "systemd-coredump.socket" "systemd-coredump@.service" @@ -76,8 +74,8 @@ in users.groups.systemd-coredump = { }; }) - (mkIf (!cfg.enable) { - boot.kernel.sysctl."kernel.core_pattern" = mkDefault "core"; + (lib.mkIf (!cfg.enable) { + boot.kernel.sysctl."kernel.core_pattern" = lib.mkDefault "core"; }) ];