nixos/coredump: drop with lib;

Prefix `lib.` on `mkOption`, `types`, `mkIf`, `mkMerge` and `mkDefault` so the module no longer relies on `with lib;`. No behavioural change.
This commit is contained in:
Jamie Magee
2026-05-03 14:25:53 -07:00
parent ac3bc672c5
commit b3a443cd89

View File

@@ -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";
})
];