system.sysctl: 整理

This commit is contained in:
陈浩南 2024-03-27 18:47:56 +08:00
parent 53a2a6ff0c
commit b04b1375d0

View File

@ -4,11 +4,7 @@ inputs:
{ {
laptop-mode = mkOption { type = types.nullOr types.int; default = null; }; laptop-mode = mkOption { type = types.nullOr types.int; default = null; };
}; };
config = config = let inherit (inputs.config.nixos.system) sysctl; in inputs.lib.mkMerge
let
inherit (inputs.lib) mkIf mkMerge;
inherit (inputs.config.nixos.system) sysctl;
in mkMerge
[ [
{ {
boot.kernel.sysctl = boot.kernel.sysctl =
@ -19,6 +15,6 @@ inputs:
"kernel.sysrq" = 438; "kernel.sysrq" = 438;
}; };
} }
(mkIf (sysctl.laptop-mode != null) { boot.kernel.sysctl."vm.laptop_mode" = sysctl.laptop-mode; }) (inputs.lib.mkIf (sysctl.laptop-mode != null) { boot.kernel.sysctl."vm.laptop_mode" = sysctl.laptop-mode; })
]; ];
} }