diff --git a/flake.lock b/flake.lock index b9dadbff..5e19ce18 100644 --- a/flake.lock +++ b/flake.lock @@ -553,6 +553,23 @@ "type": "github" } }, + "linux-asus": { + "flake": false, + "locked": { + "lastModified": 1763490343, + "narHash": "sha256-aiCPWxyVBNfqB8Gw9OwrrEP3c+liUBZbEW6aTIrd+TE=", + "owner": "asus-linux", + "repo": "linux-g14", + "rev": "29faef816326f31b4d9d3e19c1f9a8ffe9005e8a", + "type": "gitlab" + }, + "original": { + "owner": "asus-linux", + "ref": "6.17", + "repo": "linux-g14", + "type": "gitlab" + } + }, "mac-style": { "flake": false, "locked": { @@ -1252,6 +1269,7 @@ "home-manager": "home-manager", "impermanence": "impermanence", "lepton": "lepton", + "linux-asus": "linux-asus", "mac-style": "mac-style", "matplotplusplus": "matplotplusplus", "mirism-old": "mirism-old", diff --git a/flake.nix b/flake.nix index a2308029..25ce09fe 100644 --- a/flake.nix +++ b/flake.nix @@ -68,6 +68,7 @@ pybinding = { url = "git+https://github.com/dean0x7d/pybinding?submodules=1"; flake = false; }; brokenaxes = { url = "github:bendichter/brokenaxes"; flake = false; }; mirism-old = { url = "github:CHN-beta/mirism-old-public"; flake = false; }; + linux-asus = { url = "gitlab:asus-linux/linux-g14/6.17"; flake = false; }; }; outputs = inputs: let localLib = import ./flake/lib inputs.nixpkgs.lib; in diff --git a/modules/hardware/asus/default.nix b/modules/hardware/asus/default.nix index 8defc6e4..74ac62ba 100644 --- a/modules/hardware/asus/default.nix +++ b/modules/hardware/asus/default.nix @@ -10,5 +10,6 @@ inputs: supergfxd.enable = false; }; programs.rog-control-center = { enable = true; autoStart = true; }; + nixos.system.kernel.patches = [ "asus" ]; }; } diff --git a/modules/system/kernel/default.nix b/modules/system/kernel/default.nix index e55fa3e6..40cf68cb 100644 --- a/modules/system/kernel/default.nix +++ b/modules/system/kernel/default.nix @@ -78,6 +78,16 @@ inputs: }; structuredExtraConfig.BTRFS_EXPERIMENTAL = inputs.lib.kernel.yes; }]; + asus = builtins.map + (file: + { + name = "asus-${file.name}"; + patch = "${inputs.topInputs.linux-asus}/${file.name}"; + }) + (builtins.filter + (file: file.value == "regular" && inputs.lib.hasSuffix ".patch" file.name + && !(inputs.lib.hasInfix "more-uarches" file.name)) + (inputs.localLib.attrsToList (builtins.readDir "${inputs.topInputs.linux-asus}"))); }; in builtins.concatLists (builtins.map (name: patches.${name}) kernel.patches); };