From 484e22bf0398ecf65890b1397d5bf5e2cdf03b1b Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Tue, 20 Feb 2024 08:55:19 -0500 Subject: [PATCH] fix mainline kernel --- README.md | 9 ++++++++- module.nix | 18 +++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 09caccd..de4f0bd 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ A binary cache is provided through Cachix so you can avoid re-building the kerne https://app.cachix.org/cache/nixos-x13s -Ensure you are not overriding the nixpkgs input when consuming this flake, or you may not be able to take advantags of this cache. +Ensure you are not overriding the nixpkgs input when consuming this flake, or you may not be able to take advantages of this cache. ## Add with a flake @@ -30,6 +30,13 @@ Ensure you are not overriding the nixpkgs input when consuming this flake, or yo inputs.nixos-x13s.nixosModules.default { nixos-x13s.enable = true; + nixos-x13s.kernel = "jhovold"; # jhovold is default, but steev and mainline supported + + # install multiple kernels! note this increases eval time for each specialization + specialisation = { + mainline.configuration.nixos-x13s.kernel = "mainline"; + steev.configuration.nixos-x13s.kernel = "steev"; + }; # allow unfree firmware nixpkgs.config.allowUnfree = true; diff --git a/module.nix b/module.nix index c11c490..a8bb263 100644 --- a/module.nix +++ b/module.nix @@ -10,14 +10,18 @@ let x13sPackages = import ./packages/default.nix { inherit lib pkgs; }; dtbName = "sc8280xp-lenovo-thinkpad-x13s.dtb"; - linuxPackages_x13s = pkgs.linuxPackagesFor ( - if cfg.kernel == "jhovold" then - x13sPackages.linux_jhovold - else if cfg.kernel == "steev" then - x13sPackages.linux_steev - else + linuxPackages_x13s = + if cfg.kernel == "mainline" then pkgs.linuxPackages_latest - ); + else + pkgs.linuxPackagesFor ( + if cfg.kernel == "jhovold" then + x13sPackages.linux_jhovold + else if cfg.kernel == "steev" then + x13sPackages.linux_steev + else + throw "Unsupported kernel" + ); dtb = "${linuxPackages_x13s.kernel}/dtbs/qcom/${dtbName}"; alsa-ucm-conf-env.ALSA_CONFIG_UCM2 = "${x13sPackages."x13s/alsa-ucm-conf"}/share/alsa/ucm2";