system.kernel: port some change from xddxdd/nur-packages

This commit is contained in:
陈浩南 2023-12-20 11:28:31 +08:00
parent 69c528a03d
commit 6a6625d585
2 changed files with 15 additions and 2 deletions

View File

@ -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;

View File

@ -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;