From 6a6625d58589e0b117a068121c2ae1b299967c1b Mon Sep 17 00:00:00 2001 From: chn Date: Wed, 20 Dec 2023 11:28:31 +0800 Subject: [PATCH] system.kernel: port some change from xddxdd/nur-packages --- flake.nix | 2 +- modules/system/kernel.nix | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 2485a904..3a93199d 100644 --- a/flake.nix +++ b/flake.nix @@ -116,7 +116,7 @@ }; nixpkgs = { march = "alderlake"; cuda = { enable = true; capabilities = [ "8.6" ]; forwardCompat = false; }; }; - kernel.patches = [ "cjktty" ]; + kernel.patches = [ "cjktty" "lantian" ]; impermanence.enable = true; networking.hostname = "pc"; sysctl.laptop-mode = 5; diff --git a/modules/system/kernel.nix b/modules/system/kernel.nix index 3670e076..58f120c9 100644 --- a/modules/system/kernel.nix +++ b/modules/system/kernel.nix @@ -2,7 +2,7 @@ inputs: { options.nixos.system.kernel = let inherit (inputs.lib) mkOption types; in { - patches = mkOption { type = types.listOf (types.enum [ "cjktty" ]); default = []; }; + patches = mkOption { type = types.listOf types.nonEmptyStr; default = []; }; modules = { install = mkOption { type = types.listOf types.str; default = []; }; @@ -61,6 +61,19 @@ inputs: extraStructuredConfig = { FONT_CJK_16x16 = inputs.lib.kernel.yes; FONT_CJK_32x32 = inputs.lib.kernel.yes; }; }; + lantian = + { + patch = null; + # pick from xddxdd/nur-packages dce93a + extraStructuredConfig = with inputs.lib.kernel; + { + ACPI_PCI_SLOT = yes; + ENERGY_MODEL = yes; + PARAVIRT_TIME_ACCOUNTING = yes; + PM_AUTOSLEEP = yes; + WQ_POWER_EFFICIENT_DEFAULT = yes; + }; + }; }; in builtins.map (name: { inherit name; } // patches.${name}) kernel.patches;