diff --git a/flake.lock b/flake.lock index a3a846b6..f8960d2c 100644 --- a/flake.lock +++ b/flake.lock @@ -665,6 +665,23 @@ "type": "github" } }, + "linux-asus": { + "flake": false, + "locked": { + "lastModified": 1766306646, + "narHash": "sha256-xDjM8XkKOhIMTenpjjWuQFDSM3RBA/tPWNSbOd1MDdQ=", + "owner": "asus-linux", + "repo": "linux-g14", + "rev": "35bffaf767dd85280adc54958038dbe9d8041d68", + "type": "gitlab" + }, + "original": { + "owner": "asus-linux", + "ref": "6.18", + "repo": "linux-g14", + "type": "gitlab" + } + }, "mac-style": { "flake": false, "locked": { @@ -1442,6 +1459,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 e7c84e3b..556ea55c 100644 --- a/flake.nix +++ b/flake.nix @@ -65,6 +65,7 @@ mirism-old = { url = "github:CHN-beta/mirism-old-public"; flake = false; }; sqlgen = { url = "git+https://github.com/getml/sqlgen?submodules=1"; flake = false; }; reflectcpp = { url = "git+https://github.com/getml/reflect-cpp?submodules=1"; flake = false; }; + linux-asus = { url = "gitlab:asus-linux/linux-g14/6.18"; 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 2acbfce7..49720149 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; + nixos.system.kernel.patches = [ "asus" ]; }; } diff --git a/modules/system/kernel.nix b/modules/system/kernel.nix index 3264e1f3..3ece4f83 100644 --- a/modules/system/kernel.nix +++ b/modules/system/kernel.nix @@ -67,6 +67,16 @@ inputs: patches = { btrfs = [(inputs.topInputs.self.src.btrfs.${version} // { name = "btrfs"; })]; + 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); };