From 1c72da4c6984387953278956d9f77a4cda67ed91 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Thu, 5 Sep 2024 21:52:04 +0200 Subject: [PATCH 01/12] remove unmaintained assertion --- module.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/module.nix b/module.nix index 61c066a..f6168bc 100644 --- a/module.nix +++ b/module.nix @@ -56,13 +56,6 @@ in }; config = lib.mkIf cfg.enable { - assertions = [ - { - assertion = false; - message = "adamcstephens/nixos-x13s is no longer maintained"; - } - ]; - environment.systemPackages = [ pkgs.efibootmgr ]; hardware.enableAllFirmware = true; From 99a7228961989dbcdc4459490a411d758e4b37ed Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Thu, 5 Sep 2024 22:09:47 +0200 Subject: [PATCH 02/12] remove npins, add nix formatter, bump to jhovold 6.11-rc6 --- flake.lock | 38 ++++++++++++++++++++++-------- flake.nix | 14 +++++++++-- module.nix | 4 +--- npins/default.nix | 47 ------------------------------------- npins/sources.json | 17 -------------- packages/default.nix | 12 ++++++---- packages/part.nix | 9 ++++++-- update.py | 55 -------------------------------------------- 8 files changed, 56 insertions(+), 140 deletions(-) delete mode 100644 npins/default.nix delete mode 100644 npins/sources.json delete mode 100755 update.py diff --git a/flake.lock b/flake.lock index 3dc68ab..26823f1 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1719994518, - "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "lastModified": 1725234343, + "narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "rev": "567b938d64d4b4112ee253b9274472dc3a346eb6", "type": "github" }, "original": { @@ -18,13 +18,30 @@ "type": "github" } }, + "linux-jhovold": { + "flake": false, + "locked": { + "lastModified": 1725261528, + "narHash": "sha256-p2rP8fErEnrlrkl2l4ZfnWOG2U/ohAC9blx+sTpU4+I=", + "owner": "jhovold", + "repo": "linux", + "rev": "2997053728cd0675469399212061423e63b48c1f", + "type": "github" + }, + "original": { + "owner": "jhovold", + "ref": "wip/sc8280xp-6.11-rc6", + "repo": "linux", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1722062969, - "narHash": "sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg=", + "lastModified": 1725432240, + "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b73c2221a46c13557b1b3be9c2070cc42cf01eb3", + "rev": "ad416d066ca1222956472ab7d0555a6946746a80", "type": "github" }, "original": { @@ -36,19 +53,20 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1719876945, - "narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=", + "lastModified": 1725233747, + "narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" }, "original": { "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" } }, "root": { "inputs": { "flake-parts": "flake-parts", + "linux-jhovold": "linux-jhovold", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index f0ea0ca..bfde85e 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,9 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; + + linux-jhovold.url = "github:jhovold/linux/wip/sc8280xp-6.11-rc6"; + linux-jhovold.flake = false; }; outputs = @@ -21,7 +24,7 @@ { pkgs, ... }: { devShells = rec { - default = pkgs.mkShellNoCC { packages = [ pkgs.npins ] ++ ci.nativeBuildInputs; }; + default = pkgs.mkShellNoCC { packages = ci.nativeBuildInputs; }; ci = pkgs.mkShellNoCC { packages = [ @@ -36,9 +39,16 @@ ]; }; }; + + formatter = pkgs.nixfmt-rfc-style; }; - flake.nixosModules.default = import ./module.nix { inherit dtbName; }; + flake.nixosModules.default = import ./module.nix { + inherit dtbName; + + # FIXME: don't hardcode this with the arch + x13sPackages = self.packages.aarch64-linux; + }; flake.nixosConfigurations = { example = inputs.nixpkgs.lib.nixosSystem { diff --git a/module.nix b/module.nix index f6168bc..c91cd9b 100644 --- a/module.nix +++ b/module.nix @@ -1,4 +1,4 @@ -{ dtbName }: +{ dtbName, x13sPackages }: { config, lib, @@ -9,8 +9,6 @@ let cfg = config.nixos-x13s; - x13sPackages = import ./packages/default.nix { inherit lib pkgs; }; - linuxPackages_x13s = if cfg.kernel == "mainline" then pkgs.linuxPackages_latest diff --git a/npins/default.nix b/npins/default.nix deleted file mode 100644 index 4a7c372..0000000 --- a/npins/default.nix +++ /dev/null @@ -1,47 +0,0 @@ -# Generated by npins. Do not modify; will be overwritten regularly -let - data = builtins.fromJSON (builtins.readFile ./sources.json); - version = data.version; - - mkSource = spec: - assert spec ? type; let - path = - if spec.type == "Git" then mkGitSource spec - else if spec.type == "GitRelease" then mkGitSource spec - else if spec.type == "PyPi" then mkPyPiSource spec - else if spec.type == "Channel" then mkChannelSource spec - else builtins.throw "Unknown source type ${spec.type}"; - in - spec // { outPath = path; }; - - mkGitSource = { repository, revision, url ? null, hash, ... }: - assert repository ? type; - # At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository - # In the latter case, there we will always be an url to the tarball - if url != null then - (builtins.fetchTarball { - inherit url; - sha256 = hash; # FIXME: check nix version & use SRI hashes - }) - else assert repository.type == "Git"; builtins.fetchGit { - url = repository.url; - rev = revision; - # hash = hash; - }; - - mkPyPiSource = { url, hash, ... }: - builtins.fetchurl { - inherit url; - sha256 = hash; - }; - - mkChannelSource = { url, hash, ... }: - builtins.fetchTarball { - inherit url; - sha256 = hash; - }; -in -if version == 3 then - builtins.mapAttrs (_: mkSource) data.pins -else - throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`" diff --git a/npins/sources.json b/npins/sources.json deleted file mode 100644 index 6224ea5..0000000 --- a/npins/sources.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "pins": { - "linux-jhovold": { - "type": "Git", - "repository": { - "type": "GitHub", - "owner": "jhovold", - "repo": "linux" - }, - "branch": "wip/sc8280xp-6.11-rc1", - "revision": "9c6b81022b9c277d65c68e25f4cfd52f33ef8f28", - "url": "https://github.com/jhovold/linux/archive/9c6b81022b9c277d65c68e25f4cfd52f33ef8f28.tar.gz", - "hash": "13c6r67iy8y750f8zpals4l941lshxx3w3ar1ss9dizsqjsghdsr" - } - }, - "version": 3 -} \ No newline at end of file diff --git a/packages/default.nix b/packages/default.nix index f4a84f7..d9f0fcf 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -1,6 +1,10 @@ -{ lib, pkgs, ... }: +{ + inputs, + lib, + pkgs, + ... +}: let - sources = import ../npins; linux_x13s_pkg = { version, buildLinux, ... }@args: @@ -16,8 +20,8 @@ let in { linux_jhovold = pkgs.callPackage linux_x13s_pkg { - src = sources.linux-jhovold; - version = "6.11.0-rc1"; + src = inputs.linux-jhovold; + version = "6.11-rc6"; defconfig = "johan_defconfig"; }; diff --git a/packages/part.nix b/packages/part.nix index a665de7..6983c9a 100644 --- a/packages/part.nix +++ b/packages/part.nix @@ -1,4 +1,9 @@ -{ lib, withSystem, ... }: +{ + inputs, + lib, + withSystem, + ... +}: { perSystem = { pkgs, ... }: @@ -10,6 +15,6 @@ }; flake.packages.aarch64-linux = withSystem "aarch64-linux" ( - { pkgs, ... }: import ./default.nix { inherit lib pkgs; } + { pkgs, ... }: import ./default.nix { inherit inputs lib pkgs; } ); } diff --git a/update.py b/update.py deleted file mode 100755 index efcb733..0000000 --- a/update.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python3 - -from github import Github -import sys -import re -from packaging.version import Version -from subprocess import run - -latest_version: str = "0" -latest_branch: str = "" -previous_version: str = "" - -with Github() as gh: - for branch in gh.get_user("jhovold").get_repo("linux").get_branches(): - v = re.match("wip/sc8280xp-((v?6.[0-9]+)(-rc[0-9]+)?)", branch.name) - if v != None and Version(v.group(1)) > Version(latest_version): - # add .0 to version - latest_version = f"{v.group(2)}.0{v.group(3) or ''}" - latest_branch = v.group(0) - -print("branch: " + latest_branch) -print("latest: " + latest_version) - -with open("packages/default.nix", "r") as f: - lines = f.readlines() - -for line in lines: - v = re.match(r'^\s*version = "(6[.0-9-rc]+)";.*$', line) - if v != None: - previous_version = v.group(1) - -print("previous: " + previous_version) - -if previous_version == latest_version: - print("No update found, exiting.") - sys.exit(1) - -with open("packages/default.nix", "w") as f: - for line in lines: - f.write( - re.sub( - r'^(\s*version = ")6[.0-9-rc]+(";.*$)', - rf"\g<1>{latest_version}\2", - line, - ) - ) - -run( - f"npins add --name linux-jhovold github --branch {latest_branch} jhovold linux".split( - " " - ) -) - -run("git add npins/ packages/default.nix".split(" ")) -run(["git", "commit", "-m", f"jhovold: {previous_version} -> {latest_version}"]) From 759bf531bb9ffa1a45cabb01c6ee1bdb23b9b49b Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Fri, 6 Sep 2024 09:03:05 +0200 Subject: [PATCH 03/12] fix modVersion --- packages/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/default.nix b/packages/default.nix index d9f0fcf..97094c7 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -21,7 +21,7 @@ in { linux_jhovold = pkgs.callPackage linux_x13s_pkg { src = inputs.linux-jhovold; - version = "6.11-rc6"; + version = "6.11.0-rc6"; defconfig = "johan_defconfig"; }; From 1286d20be2321a1a2d27f5d09257ebaf54ce0630 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Wed, 2 Oct 2024 20:41:53 +0200 Subject: [PATCH 04/12] feat(linux_jhovold): bump to 6.11.0 --- flake.lock | 8 ++++---- flake.nix | 2 +- packages/default.nix | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 26823f1..00413f1 100644 --- a/flake.lock +++ b/flake.lock @@ -21,16 +21,16 @@ "linux-jhovold": { "flake": false, "locked": { - "lastModified": 1725261528, - "narHash": "sha256-p2rP8fErEnrlrkl2l4ZfnWOG2U/ohAC9blx+sTpU4+I=", + "lastModified": 1726563586, + "narHash": "sha256-hZ8yue7OsrXuwoXz09/dmIiKJIQEPixK39l5S/xvJfA=", "owner": "jhovold", "repo": "linux", - "rev": "2997053728cd0675469399212061423e63b48c1f", + "rev": "c8032fa3062e04cbb68f070959fc746b91abb16e", "type": "github" }, "original": { "owner": "jhovold", - "ref": "wip/sc8280xp-6.11-rc6", + "ref": "wip/sc8280xp-6.11", "repo": "linux", "type": "github" } diff --git a/flake.nix b/flake.nix index bfde85e..bc90fce 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; - linux-jhovold.url = "github:jhovold/linux/wip/sc8280xp-6.11-rc6"; + linux-jhovold.url = "github:jhovold/linux/wip/sc8280xp-6.11"; linux-jhovold.flake = false; }; diff --git a/packages/default.nix b/packages/default.nix index 97094c7..932b79f 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -21,7 +21,7 @@ in { linux_jhovold = pkgs.callPackage linux_x13s_pkg { src = inputs.linux-jhovold; - version = "6.11.0-rc6"; + version = "6.11.0"; defconfig = "johan_defconfig"; }; From d354461ec22e3a091c159a1826cf20ab4fff5f79 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Fri, 11 Oct 2024 10:19:32 +0200 Subject: [PATCH 05/12] feat(linux_jhovold): bump to 6.12.0-rc2 --- flake.lock | 8 ++++---- flake.nix | 2 +- packages/default.nix | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 00413f1..422ac12 100644 --- a/flake.lock +++ b/flake.lock @@ -21,16 +21,16 @@ "linux-jhovold": { "flake": false, "locked": { - "lastModified": 1726563586, - "narHash": "sha256-hZ8yue7OsrXuwoXz09/dmIiKJIQEPixK39l5S/xvJfA=", + "lastModified": 1728631036, + "narHash": "sha256-1LnClVjY6WS+IR9eqPFA7gzXm0cio3mY23NXj9cKHHs=", "owner": "jhovold", "repo": "linux", - "rev": "c8032fa3062e04cbb68f070959fc746b91abb16e", + "rev": "6a97bc22fa36010400b91e6d5979741c391112c3", "type": "github" }, "original": { "owner": "jhovold", - "ref": "wip/sc8280xp-6.11", + "ref": "wip/sc8280xp-6.12-rc2", "repo": "linux", "type": "github" } diff --git a/flake.nix b/flake.nix index bc90fce..aaa2ed3 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; - linux-jhovold.url = "github:jhovold/linux/wip/sc8280xp-6.11"; + linux-jhovold.url = "github:jhovold/linux/wip/sc8280xp-6.12-rc2"; linux-jhovold.flake = false; }; diff --git a/packages/default.nix b/packages/default.nix index 932b79f..490a0be 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -21,7 +21,7 @@ in { linux_jhovold = pkgs.callPackage linux_x13s_pkg { src = inputs.linux-jhovold; - version = "6.11.0"; + version = "6.12.0-rc2"; defconfig = "johan_defconfig"; }; From 5d74b79586597cc171c50fd4ab5aa8edc1ffcfc7 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Fri, 11 Oct 2024 15:24:59 +0200 Subject: [PATCH 06/12] chore: pass regulator_ignore_unused as kernel arg --- module.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module.nix b/module.nix index c91cd9b..9b1ae0f 100644 --- a/module.nix +++ b/module.nix @@ -82,7 +82,7 @@ in "clk_ignore_unused" "pd_ignore_unused" "arm64.nopauth" - # "regulator_ignore_unused" # allows for > 30 sec to load msm, at the potential cost of power + "regulator_ignore_unused" # allows for > 30 sec to load msm, at the potential cost of power ]; initrd = { From bd580ee9c35fcb8a720122d5bb2f903f1b7395ee Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Fri, 11 Oct 2024 15:25:24 +0200 Subject: [PATCH 07/12] chore(kernelModules): s/-/_/ --- module.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/module.nix b/module.nix index 9b1ae0f..5fee192 100644 --- a/module.nix +++ b/module.nix @@ -88,24 +88,24 @@ in initrd = { kernelModules = [ "nvme" - "phy-qcom-qmp-pcie" - "pcie-qcom" + "phy_qcom_qmp_pcie" + "pcie_qcom" - "i2c-core" - "i2c-hid" - "i2c-hid-of" - "i2c-qcom-geni" + "i2c_core" + "i2c_hid" + "i2c_hid-of" + "i2c_qcom-geni" "leds_qcom_lpg" "pwm_bl" "qrtr" "pmic_glink_altmode" "gpio_sbu_mux" - "phy-qcom-qmp-combo" + "phy_qcom_qmp_combo" "gpucc_sc8280xp" "dispcc_sc8280xp" "phy_qcom_edp" - "panel-edp" + "panel_edp" "msm" ]; }; From 6b9efe77ca80653354981c720af3c4241ac71490 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Fri, 11 Oct 2024 16:38:31 +0200 Subject: [PATCH 08/12] Revert "feat(linux_jhovold): bump to 6.12.0-rc2" This reverts commit d354461ec22e3a091c159a1826cf20ab4fff5f79. --- flake.lock | 8 ++++---- flake.nix | 2 +- packages/default.nix | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 422ac12..00413f1 100644 --- a/flake.lock +++ b/flake.lock @@ -21,16 +21,16 @@ "linux-jhovold": { "flake": false, "locked": { - "lastModified": 1728631036, - "narHash": "sha256-1LnClVjY6WS+IR9eqPFA7gzXm0cio3mY23NXj9cKHHs=", + "lastModified": 1726563586, + "narHash": "sha256-hZ8yue7OsrXuwoXz09/dmIiKJIQEPixK39l5S/xvJfA=", "owner": "jhovold", "repo": "linux", - "rev": "6a97bc22fa36010400b91e6d5979741c391112c3", + "rev": "c8032fa3062e04cbb68f070959fc746b91abb16e", "type": "github" }, "original": { "owner": "jhovold", - "ref": "wip/sc8280xp-6.12-rc2", + "ref": "wip/sc8280xp-6.11", "repo": "linux", "type": "github" } diff --git a/flake.nix b/flake.nix index aaa2ed3..bc90fce 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; - linux-jhovold.url = "github:jhovold/linux/wip/sc8280xp-6.12-rc2"; + linux-jhovold.url = "github:jhovold/linux/wip/sc8280xp-6.11"; linux-jhovold.flake = false; }; diff --git a/packages/default.nix b/packages/default.nix index 490a0be..932b79f 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -21,7 +21,7 @@ in { linux_jhovold = pkgs.callPackage linux_x13s_pkg { src = inputs.linux-jhovold; - version = "6.12.0-rc2"; + version = "6.11.0"; defconfig = "johan_defconfig"; }; From 9f2d78c8dbbcee731761bb9101b262fbaf0989c2 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Fri, 11 Oct 2024 22:34:41 +0200 Subject: [PATCH 09/12] Reapply "feat(linux_jhovold): bump to 6.12.0-rc2" This reverts commit 6b9efe77ca80653354981c720af3c4241ac71490. --- flake.lock | 8 ++++---- flake.nix | 2 +- packages/default.nix | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 00413f1..422ac12 100644 --- a/flake.lock +++ b/flake.lock @@ -21,16 +21,16 @@ "linux-jhovold": { "flake": false, "locked": { - "lastModified": 1726563586, - "narHash": "sha256-hZ8yue7OsrXuwoXz09/dmIiKJIQEPixK39l5S/xvJfA=", + "lastModified": 1728631036, + "narHash": "sha256-1LnClVjY6WS+IR9eqPFA7gzXm0cio3mY23NXj9cKHHs=", "owner": "jhovold", "repo": "linux", - "rev": "c8032fa3062e04cbb68f070959fc746b91abb16e", + "rev": "6a97bc22fa36010400b91e6d5979741c391112c3", "type": "github" }, "original": { "owner": "jhovold", - "ref": "wip/sc8280xp-6.11", + "ref": "wip/sc8280xp-6.12-rc2", "repo": "linux", "type": "github" } diff --git a/flake.nix b/flake.nix index bc90fce..aaa2ed3 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; - linux-jhovold.url = "github:jhovold/linux/wip/sc8280xp-6.11"; + linux-jhovold.url = "github:jhovold/linux/wip/sc8280xp-6.12-rc2"; linux-jhovold.flake = false; }; diff --git a/packages/default.nix b/packages/default.nix index 932b79f..490a0be 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -21,7 +21,7 @@ in { linux_jhovold = pkgs.callPackage linux_x13s_pkg { src = inputs.linux-jhovold; - version = "6.11.0"; + version = "6.12.0-rc2"; defconfig = "johan_defconfig"; }; From 3a60edd14779b6b1f71465593d75dcdabfecb4b1 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Fri, 11 Oct 2024 22:37:09 +0200 Subject: [PATCH 10/12] fix(kernel): compress kernel modules source: https://github.com/NixOS/nixpkgs/pull/345534/commits/88746a794398da15142f91d42c829a4336616596#diff-764a10a0418846e85912fafd206b2502db65dbbd8c59adc0532b50d05c438d21R993-R998 --- packages/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/default.nix b/packages/default.nix index 490a0be..37397d4 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -13,7 +13,17 @@ let // { modDirVersion = version; - kernelPatches = (args.kernelPatches or [ ]) ++ [ ]; + kernelPatches = (args.kernelPatches or [ ]) ++ [ + { + name = "compress-kernel-modules"; + patch = null; + extraConfig = '' + MODULE_COMPRESS y + MODULE_COMPRESS_ALL y + MODULE_COMPRESS_XZ y + ''; + } + ]; extraMeta.branch = lib.versions.majorMinor version; } ); From f691c125485b6764ebef0b9f148613d79de95525 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Fri, 11 Oct 2024 22:37:09 +0200 Subject: [PATCH 11/12] fix(kernel): compress kernel modules (different config method) source: https://github.com/NixOS/nixpkgs/pull/345534/commits/88746a794398da15142f91d42c829a4336616596#diff-764a10a0418846e85912fafd206b2502db65dbbd8c59adc0532b50d05c438d21R993-R998 --- packages/default.nix | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/packages/default.nix b/packages/default.nix index 37397d4..5674e77 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -13,17 +13,12 @@ let // { modDirVersion = version; - kernelPatches = (args.kernelPatches or [ ]) ++ [ - { - name = "compress-kernel-modules"; - patch = null; - extraConfig = '' - MODULE_COMPRESS y - MODULE_COMPRESS_ALL y - MODULE_COMPRESS_XZ y - ''; - } - ]; + structuredExtraConfig = with lib.kernel; { + MODULE_COMPRESS = yes; + MODULE_COMPRESS_ALL = yes; + MODULE_COMPRESS_XZ = yes; + }; + extraMeta.branch = lib.versions.majorMinor version; } ); From 06c0bc1b3f668c6d81f090deb9643540b6cb46d2 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Mon, 14 Oct 2024 15:02:22 +0200 Subject: [PATCH 12/12] refactor: remove multi-kernel support, clarify maintnenance --- README.md | 53 ++++------------------------------------------------- flake.nix | 2 +- module.nix | 6 +----- 3 files changed, 6 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 937bf17..4b4918e 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,20 @@ # nixos x13s > [!CAUTION] -> This project is unmaintained. +> This project is partially maintained. +> It receives kernel updates, until mainline will provide a fully functional experience. This repository aims to provide easy, shared, support for Lenovo X13s on Linux. The support for this machine is constantly improving in mainline kernel and upstream packages. Eventually the goal is that this repository is no longer necessary. -## Binary cache - -A binary cache is provided through Cachix so you can avoid re-building the kernel. - -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 advantages of this cache. - -NixOS configuration example: - -```nix - nix.settings = { - substituters = [ - "https://nixos-x13s.cachix.org" - ]; - trusted-public-keys = [ - "nixos-x13s.cachix.org-1:SzroHbidolBD3Sf6UusXp12YZ+a5ynWv0RtYF0btFos=" - ]; - }; -``` - ## Add with a flake ```nix { inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - nixos-x13s.url = "git+https://codeberg.org/adamcstephens/nixos-x13s"; + nixos-x13s.url = "git+https://codeberg.org/steveej/nixos-x13s"; }; outputs = @@ -46,13 +26,7 @@ NixOS configuration example: inputs.nixos-x13s.nixosModules.default { nixos-x13s.enable = true; - nixos-x13s.kernel = "jhovold"; # jhovold is default, but mainline supported - - # install multiple kernels! note this increases eval time for each specialization - specialisation = { - # note that activation of each specialization is required to copy the dtb to the EFI, and thus boot - mainline.configuration.nixos-x13s.kernel = "mainline"; - }; + nixos-x13s.kernel = "jhovold"; # jhovold is default # allow unfree firmware nixpkgs.config.allowUnfree = true; @@ -66,25 +40,6 @@ NixOS configuration example: } ``` -## Add using not a flake - -Clone the repository: - -``` -git clone https://codeberg.org/adamcstephens/nixos-x13s /etc/nixos/nixos-x13s -``` - -Then reference the module in your `configuration.nix` and use the module as documented in the flake example above: - -```nix - imports = - [ - ./nixos-x13s/module.nix - ]; - nixos-x13s.enable = true; - ... -``` - ## UEFI Update ISO This repository provides a package which can output the USB UEFI Update ISO. This will be updated as Lenovo releases new versions. diff --git a/flake.nix b/flake.nix index aaa2ed3..a0a9d0c 100644 --- a/flake.nix +++ b/flake.nix @@ -59,7 +59,7 @@ { config, pkgs, ... }: { nixos-x13s.enable = true; - nixos-x13s.kernel = "jhovold"; # jhovold is default, but mainline supported + nixos-x13s.kernel = "jhovold"; # jhovold is default # allow unfree firmware nixpkgs.config.allowUnfree = true; diff --git a/module.nix b/module.nix index 5fee192..0038fbe 100644 --- a/module.nix +++ b/module.nix @@ -10,9 +10,6 @@ let cfg = config.nixos-x13s; linuxPackages_x13s = - if cfg.kernel == "mainline" then - pkgs.linuxPackages_latest - else pkgs.linuxPackagesFor ( if cfg.kernel == "jhovold" then x13sPackages.linux_jhovold else throw "Unsupported kernel" ); @@ -46,9 +43,8 @@ in kernel = lib.mkOption { type = lib.types.enum [ "jhovold" - "mainline" ]; - description = "Which patched kernel to use. jhovold is the latest RC or release with some x13s specific patches, and mainline is nixos latest"; + description = "Which patched kernel to use. jhovold is the latest RC or release with some x13s specific patches."; default = "jhovold"; }; };