From 7d66d2ca4df69b2af0ef73ecdb8aa8f492458d58 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Thu, 4 Jul 2024 17:33:34 -0400 Subject: [PATCH 01/14] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01) → 'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03) • Updated input 'flake-parts/nixpkgs-lib': 'https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz?narHash=sha256-lIbdfCsf8LMFloheeE6N31%2BBMIeixqyQWbSr2vk79EQ%3D' (2024-06-01) → 'https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz?narHash=sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI%3D' (2024-07-01) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/2893f56de08021cffd9b6b6dfc70fd9ccd51eb60' (2024-06-24) → 'github:NixOS/nixpkgs/9f4128e00b0ae8ec65918efeba59db998750ead6' (2024-07-03) --- flake.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/flake.lock b/flake.lock index 190dfbe..5001fbf 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1717285511, - "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1719254875, - "narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=", + "lastModified": 1720031269, + "narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60", + "rev": "9f4128e00b0ae8ec65918efeba59db998750ead6", "type": "github" }, "original": { @@ -36,14 +36,14 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1717284937, - "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", + "lastModified": 1719876945, + "narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" }, "original": { "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" } }, "root": { From 4964bf1692084d9fffc44c74b59c4428bb91b111 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Thu, 4 Jul 2024 17:34:56 -0400 Subject: [PATCH 02/14] jhovold: 6.10.0-rc5 -> 6.10.0-rc6 --- npins/sources.json | 8 ++++---- packages/default.nix | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/npins/sources.json b/npins/sources.json index 6dbc7d2..61a9e97 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -7,10 +7,10 @@ "owner": "jhovold", "repo": "linux" }, - "branch": "wip/sc8280xp-6.10-rc5", - "revision": "fb34a1d838d061d9e2199656b832bb2ebc2dc5e3", - "url": "https://github.com/jhovold/linux/archive/fb34a1d838d061d9e2199656b832bb2ebc2dc5e3.tar.gz", - "hash": "07gsf26954qi9lspbzlc4xsan4vbiyzbfnpwbwyaxcqfibzfg6vg" + "branch": "wip/sc8280xp-6.10-rc6", + "revision": "993ae484d12ae6323647638000ed683c5222feb3", + "url": "https://github.com/jhovold/linux/archive/993ae484d12ae6323647638000ed683c5222feb3.tar.gz", + "hash": "1a6gagwxxgi4i8ypzdj21dwxxicfyzn59kpz6qharrnpc40nsi3m" } }, "version": 3 diff --git a/packages/default.nix b/packages/default.nix index dd08321..8114965 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -17,7 +17,7 @@ in rec { linux_jhovold = pkgs.callPackage linux_x13s_pkg { src = sources.linux-jhovold; - version = "6.10.0-rc5"; + version = "6.10.0-rc6"; defconfig = "johan_defconfig"; }; From a9775735409804048a4611db8d5dd9d271d2c184 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Tue, 9 Jul 2024 14:21:53 -0400 Subject: [PATCH 03/14] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/9f4128e00b0ae8ec65918efeba59db998750ead6' (2024-07-03) → 'github:NixOS/nixpkgs/655a58a72a6601292512670343087c2d75d859c1' (2024-07-08) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 5001fbf..a1c6092 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1720031269, - "narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=", + "lastModified": 1720418205, + "narHash": "sha256-cPJoFPXU44GlhWg4pUk9oUPqurPlCFZ11ZQPk21GTPU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9f4128e00b0ae8ec65918efeba59db998750ead6", + "rev": "655a58a72a6601292512670343087c2d75d859c1", "type": "github" }, "original": { From 07c7d73a57a3243cfacd11ffc97b16ea99a141b7 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Tue, 9 Jul 2024 14:23:37 -0400 Subject: [PATCH 04/14] jhovold: 6.10.0-rc6 -> 6.10.0-rc7 --- npins/sources.json | 8 ++++---- packages/default.nix | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/npins/sources.json b/npins/sources.json index 61a9e97..6d7a9a5 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -7,10 +7,10 @@ "owner": "jhovold", "repo": "linux" }, - "branch": "wip/sc8280xp-6.10-rc6", - "revision": "993ae484d12ae6323647638000ed683c5222feb3", - "url": "https://github.com/jhovold/linux/archive/993ae484d12ae6323647638000ed683c5222feb3.tar.gz", - "hash": "1a6gagwxxgi4i8ypzdj21dwxxicfyzn59kpz6qharrnpc40nsi3m" + "branch": "wip/sc8280xp-6.10-rc7", + "revision": "7665a54596d047c9033a09399894f63e9bcf34d2", + "url": "https://github.com/jhovold/linux/archive/7665a54596d047c9033a09399894f63e9bcf34d2.tar.gz", + "hash": "1nz41g7x27yrbz1q23smhlhcalrz2vx2m77pw78yp15sl2y8gb4f" } }, "version": 3 diff --git a/packages/default.nix b/packages/default.nix index 8114965..d9cb87d 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -17,7 +17,7 @@ in rec { linux_jhovold = pkgs.callPackage linux_x13s_pkg { src = sources.linux-jhovold; - version = "6.10.0-rc6"; + version = "6.10.0-rc7"; defconfig = "johan_defconfig"; }; From 7a92ed1473c9b09294a17a5a5ef935304340b9e3 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Tue, 16 Jul 2024 08:04:39 -0400 Subject: [PATCH 05/14] jhovold: 6.10.0-rc7 -> 6.10.0 --- npins/sources.json | 8 ++++---- packages/default.nix | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/npins/sources.json b/npins/sources.json index 6d7a9a5..d4eb75d 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -7,10 +7,10 @@ "owner": "jhovold", "repo": "linux" }, - "branch": "wip/sc8280xp-6.10-rc7", - "revision": "7665a54596d047c9033a09399894f63e9bcf34d2", - "url": "https://github.com/jhovold/linux/archive/7665a54596d047c9033a09399894f63e9bcf34d2.tar.gz", - "hash": "1nz41g7x27yrbz1q23smhlhcalrz2vx2m77pw78yp15sl2y8gb4f" + "branch": "wip/sc8280xp-6.10", + "revision": "f0239008542ebdcd4a94755124b5700649df5c39", + "url": "https://github.com/jhovold/linux/archive/f0239008542ebdcd4a94755124b5700649df5c39.tar.gz", + "hash": "1x34i14b8xhzvny24bmrxagwbra2m0i194ymy11ipgjgsxaarxlb" } }, "version": 3 diff --git a/packages/default.nix b/packages/default.nix index d9cb87d..14d1dd2 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -17,7 +17,7 @@ in rec { linux_jhovold = pkgs.callPackage linux_x13s_pkg { src = sources.linux-jhovold; - version = "6.10.0-rc7"; + version = "6.10.0"; defconfig = "johan_defconfig"; }; From 79dcff640302c649d16aee95e8ec18b45ddc88b5 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Tue, 16 Jul 2024 08:07:29 -0400 Subject: [PATCH 06/14] disable regulator_ignore_unused as it's not recommended --- module.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module.nix b/module.nix index 711a9f3..314c8b5 100644 --- a/module.nix +++ b/module.nix @@ -79,8 +79,8 @@ in "efi=noruntime" "clk_ignore_unused" "pd_ignore_unused" - "regulator_ignore_unused" "arm64.nopauth" + # "regulator_ignore_unused" # allows for > 30 sec to load msm, at the potential cost of power # blacklist graphics in initrd so the firmware can load from disk "rd.driver.blacklist=msm" From f1a2bace41471300aa2b0c5c98e6e37087532e16 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Tue, 16 Jul 2024 08:07:36 -0400 Subject: [PATCH 07/14] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/655a58a72a6601292512670343087c2d75d859c1' (2024-07-08) → 'github:NixOS/nixpkgs/693bc46d169f5af9c992095736e82c3488bf7dbb' (2024-07-14) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index a1c6092..c538249 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1720418205, - "narHash": "sha256-cPJoFPXU44GlhWg4pUk9oUPqurPlCFZ11ZQPk21GTPU=", + "lastModified": 1720957393, + "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "655a58a72a6601292512670343087c2d75d859c1", + "rev": "693bc46d169f5af9c992095736e82c3488bf7dbb", "type": "github" }, "original": { From 6e5b3caccbdde31fdb10106d3137933f7bb3b763 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Mon, 29 Jul 2024 14:57:26 -0400 Subject: [PATCH 08/14] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/693bc46d169f5af9c992095736e82c3488bf7dbb' (2024-07-14) → 'github:NixOS/nixpkgs/b73c2221a46c13557b1b3be9c2070cc42cf01eb3' (2024-07-27) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index c538249..3dc68ab 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1720957393, - "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=", + "lastModified": 1722062969, + "narHash": "sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "693bc46d169f5af9c992095736e82c3488bf7dbb", + "rev": "b73c2221a46c13557b1b3be9c2070cc42cf01eb3", "type": "github" }, "original": { From 5920196f4fa952e0775344d38ea9acefef6089a2 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Mon, 29 Jul 2024 14:58:57 -0400 Subject: [PATCH 09/14] jhovold: 6.10.0 -> 6.11.0-rc1 --- npins/sources.json | 8 ++++---- packages/default.nix | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/npins/sources.json b/npins/sources.json index d4eb75d..6224ea5 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -7,10 +7,10 @@ "owner": "jhovold", "repo": "linux" }, - "branch": "wip/sc8280xp-6.10", - "revision": "f0239008542ebdcd4a94755124b5700649df5c39", - "url": "https://github.com/jhovold/linux/archive/f0239008542ebdcd4a94755124b5700649df5c39.tar.gz", - "hash": "1x34i14b8xhzvny24bmrxagwbra2m0i194ymy11ipgjgsxaarxlb" + "branch": "wip/sc8280xp-6.11-rc1", + "revision": "9c6b81022b9c277d65c68e25f4cfd52f33ef8f28", + "url": "https://github.com/jhovold/linux/archive/9c6b81022b9c277d65c68e25f4cfd52f33ef8f28.tar.gz", + "hash": "13c6r67iy8y750f8zpals4l941lshxx3w3ar1ss9dizsqjsghdsr" } }, "version": 3 diff --git a/packages/default.nix b/packages/default.nix index 14d1dd2..af6821a 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -17,7 +17,7 @@ in rec { linux_jhovold = pkgs.callPackage linux_x13s_pkg { src = sources.linux-jhovold; - version = "6.10.0"; + version = "6.11.0-rc1"; defconfig = "johan_defconfig"; }; From e6d95a3a60a066c6a1381dfaf151721767a9abde Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Mon, 29 Jul 2024 22:29:57 -0400 Subject: [PATCH 10/14] try out another iso builder --- flake.nix | 55 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/flake.nix b/flake.nix index e57a463..d4e92f0 100644 --- a/flake.nix +++ b/flake.nix @@ -49,21 +49,19 @@ system = "aarch64-linux"; modules = [ self.nixosModules.default - { - nixos-x13s.enable = true; - nixos-x13s.kernel = "jhovold"; # jhovold is default, but mainline supported + ( + { config, pkgs, ... }: + { + 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 = { - # mainline.configuration.nixos-x13s.kernel = "mainline"; - # }; + # allow unfree firmware + nixpkgs.config.allowUnfree = true; - # allow unfree firmware - nixpkgs.config.allowUnfree = true; - - # define your fileSystems - fileSystems."/".device = "/dev/notreal"; - } + # define your fileSystems + fileSystems."/".device = "/dev/notreal"; + } + ) ]; }; @@ -73,13 +71,42 @@ self.nixosModules.default ( - { modulesPath, config, ... }: + { + modulesPath, + config, + lib, + pkgs, + ... + }: let dtb = "${config.boot.kernelPackages.kernel}/dtbs/qcom/${dtbName}"; + image = import "${inputs.nixpkgs}/nixos/lib/make-disk-image.nix" { + inherit config lib pkgs; + + name = "nixos-x13s-bootstrap"; + diskSize = "auto"; + format = "raw"; + partitionTableType = "efi"; + copyChannel = false; + }; + in { imports = [ "${toString modulesPath}/installer/cd-dvd/iso-image.nix" ]; + hardware.deviceTree = { + enable = true; + name = "qcom/${dtbName}"; + }; + + system.build.bootstrap-image = image; + + boot.initrd.systemd.enable = true; + boot.initrd.systemd.emergencyAccess = true; + boot.loader.grub.enable = false; + boot.loader.systemd-boot.enable = true; + boot.loader.systemd-boot.graceful = true; + nixpkgs.config.allowUnfree = true; nixos-x13s = { From 8e16dc9e6a71ff3cfe5050e52875cd3a365e719b Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Mon, 29 Jul 2024 22:33:01 -0400 Subject: [PATCH 11/14] pd-mapper is now in-kernel --- module.nix | 18 +--------- packages/default.nix | 5 --- packages/pd-mapper/default.nix | 36 ------------------- .../pd-mapper/pd-mapper-firmware-path.diff | 13 ------- packages/qrtr/default.nix | 26 -------------- packages/uncompressed-firmware.nix | 24 ------------- 6 files changed, 1 insertion(+), 121 deletions(-) delete mode 100644 packages/pd-mapper/default.nix delete mode 100644 packages/pd-mapper/pd-mapper-firmware-path.diff delete mode 100644 packages/qrtr/default.nix delete mode 100644 packages/uncompressed-firmware.nix diff --git a/module.nix b/module.nix index 314c8b5..1afe684 100644 --- a/module.nix +++ b/module.nix @@ -41,27 +41,11 @@ in }; config = lib.mkIf cfg.enable { - environment.systemPackages = [ - pkgs.efibootmgr - (x13sPackages.uncompressed-firmware.override { - firmwareFilesList = lib.flatten options.hardware.firmware.definitions; - }) - ]; - - environment.pathsToLink = [ "/share/uncompressed-firmware" ]; + environment.systemPackages = [ pkgs.efibootmgr ]; hardware.enableAllFirmware = true; hardware.firmware = [ x13sPackages."x13s/extra-firmware" ]; - systemd.services.pd-mapper = { - wantedBy = [ "multi-user.target" ]; - - serviceConfig = { - ExecStart = "${lib.getExe x13sPackages.pd-mapper}"; - Restart = "always"; - }; - }; - boot = { loader.efi.canTouchEfiVariables = true; loader.systemd-boot.enable = lib.mkDefault true; diff --git a/packages/default.nix b/packages/default.nix index af6821a..9e09493 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -21,10 +21,5 @@ rec { defconfig = "johan_defconfig"; }; - pd-mapper = pkgs.callPackage ./pd-mapper { inherit qrtr; }; - qrtr = pkgs.callPackage ./qrtr { }; - "x13s/extra-firmware" = pkgs.callPackage ./extra-firmware.nix { }; - - uncompressed-firmware = pkgs.callPackage ./uncompressed-firmware.nix { }; } diff --git a/packages/pd-mapper/default.nix b/packages/pd-mapper/default.nix deleted file mode 100644 index d0f4fde..0000000 --- a/packages/pd-mapper/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ - stdenv, - lib, - fetchFromGitHub, - qrtr, - xz, -}: - -stdenv.mkDerivation { - pname = "pd-mapper"; - version = "unstable-2023-09-01"; - - buildInputs = [ - qrtr - xz - ]; - - src = fetchFromGitHub { - owner = "andersson"; - repo = "pd-mapper"; - rev = "10997ba7c43a3787a40b6b1b161408033e716374"; - hash = "sha256-qGrYNoPCxtdpTdbkSmB39+6/pSXml96Aul8b9opF9Lc="; - }; - - patches = [ ./pd-mapper-firmware-path.diff ]; - - installFlags = [ "prefix=$(out)" ]; - - meta = with lib; { - description = "Qualcomm PD mapper"; - homepage = "https://github.com/andersson/pd-mapper"; - license = licenses.bsd3; - mainProgram = "pd-mapper"; - platforms = platforms.aarch64; - }; -} diff --git a/packages/pd-mapper/pd-mapper-firmware-path.diff b/packages/pd-mapper/pd-mapper-firmware-path.diff deleted file mode 100644 index 8e58e4d..0000000 --- a/packages/pd-mapper/pd-mapper-firmware-path.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/pd-mapper.c b/pd-mapper.c -index 65c4b80..669d9a0 100644 ---- a/pd-mapper.c -+++ b/pd-mapper.c -@@ -194,7 +194,7 @@ static int pd_load_map(const char *file) - } - - #ifndef ANDROID --#define FIRMWARE_BASE "/lib/firmware/" -+#define FIRMWARE_BASE "/run/current-system/sw/share/uncompressed-firmware/" - #else - #define FIRMWARE_BASE "/vendor/firmware/" - #endif diff --git a/packages/qrtr/default.nix b/packages/qrtr/default.nix deleted file mode 100644 index 7dc6e44..0000000 --- a/packages/qrtr/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - stdenv, - lib, - fetchFromGitHub, -}: - -stdenv.mkDerivation { - pname = "qrtr"; - version = "unstable-2023-01-17"; - - src = fetchFromGitHub { - owner = "andersson"; - repo = "qrtr"; - rev = "d0d471c96e7d112fac6f48bd11f9e8ce209c04d2"; - hash = "sha256-KF0gCBRw3BDJdK1s+dYhHkokVTHwRFO58ho0IwHPehc="; - }; - - installFlags = [ "prefix=$(out)" ]; - - meta = with lib; { - description = "QMI IDL compiler"; - homepage = "https://github.com/andersson/qrtr"; - license = licenses.bsd3; - platforms = platforms.aarch64; - }; -} diff --git a/packages/uncompressed-firmware.nix b/packages/uncompressed-firmware.nix deleted file mode 100644 index 8fe5d3a..0000000 --- a/packages/uncompressed-firmware.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - runCommand, - buildEnv, - firmwareFilesList ? [ ], -}: -runCommand "qcom-modem-uncompressed-firmware-share" - { - firmwareFiles = buildEnv { - name = "qcom-modem-uncompressed-firmware"; - paths = firmwareFilesList; - pathsToLink = [ - "/lib/firmware/rmtfs" - "/lib/firmware/qcom" - ]; - }; - } - '' - PS4=" $ " - ( - set -x - mkdir -p $out/share/ - ln -s $firmwareFiles/lib/firmware/ $out/share/uncompressed-firmware - ) - '' From 14777d1f0c44626b7e48a6fe7318f7370ce6e4de Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Tue, 30 Jul 2024 22:25:13 -0400 Subject: [PATCH 12/14] finally load the gpu firmware in initrd --- flake.nix | 40 ++++++++++++++++++++----------------- module.nix | 27 ++++++++++++++++++++----- packages/default.nix | 15 ++++++++++++-- packages/extra-firmware.nix | 21 ------------------- 4 files changed, 57 insertions(+), 46 deletions(-) delete mode 100644 packages/extra-firmware.nix diff --git a/flake.nix b/flake.nix index d4e92f0..ad80416 100644 --- a/flake.nix +++ b/flake.nix @@ -79,7 +79,6 @@ ... }: let - dtb = "${config.boot.kernelPackages.kernel}/dtbs/qcom/${dtbName}"; image = import "${inputs.nixpkgs}/nixos/lib/make-disk-image.nix" { inherit config lib pkgs; @@ -92,8 +91,6 @@ in { - imports = [ "${toString modulesPath}/installer/cd-dvd/iso-image.nix" ]; - hardware.deviceTree = { enable = true; name = "qcom/${dtbName}"; @@ -101,11 +98,18 @@ system.build.bootstrap-image = image; - boot.initrd.systemd.enable = true; - boot.initrd.systemd.emergencyAccess = true; - boot.loader.grub.enable = false; - boot.loader.systemd-boot.enable = true; - boot.loader.systemd-boot.graceful = true; + boot = { + initrd = { + systemd.enable = true; + systemd.emergencyAccess = true; + }; + + loader = { + grub.enable = false; + systemd-boot.enable = true; + systemd-boot.graceful = true; + }; + }; nixpkgs.config.allowUnfree = true; @@ -114,16 +118,16 @@ bluetoothMac = "02:68:b3:29:da:98"; }; - isoImage = { - makeEfiBootable = true; - makeUsbBootable = true; - - contents = [ - { - source = dtb; - target = "/x13s.dtb"; - } - ]; + fileSystems = { + "/boot" = { + fsType = "vfat"; + device = "/dev/disk/by-label/ESP"; + }; + "/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + autoResize = true; + }; }; } ) diff --git a/module.nix b/module.nix index 1afe684..f6168bc 100644 --- a/module.nix +++ b/module.nix @@ -20,6 +20,21 @@ let ); dtb = "${linuxPackages_x13s.kernel}/dtbs/qcom/${dtbName}"; dtbEfiPath = "dtbs/x13s.dtb"; + + modulesClosure = pkgs.makeModulesClosure { + rootModules = config.boot.initrd.availableKernelModules ++ config.boot.initrd.kernelModules; + kernel = config.system.modulesTree; + firmware = config.hardware.firmware; + allowMissing = false; + }; + + modulesWithExtra = pkgs.symlinkJoin { + name = "modules-closure"; + paths = [ + modulesClosure + x13sPackages.graphics-firmware + ]; + }; in { options.nixos-x13s = { @@ -44,9 +59,14 @@ in environment.systemPackages = [ pkgs.efibootmgr ]; hardware.enableAllFirmware = true; - hardware.firmware = [ x13sPackages."x13s/extra-firmware" ]; + hardware.firmware = lib.mkBefore [ x13sPackages.graphics-firmware ]; boot = { + initrd.systemd.enable = true; + initrd.systemd.contents = { + "/lib".source = lib.mkForce "${modulesWithExtra}/lib"; + }; + loader.efi.canTouchEfiVariables = true; loader.systemd-boot.enable = lib.mkDefault true; loader.systemd-boot.extraFiles = { @@ -65,9 +85,6 @@ in "pd_ignore_unused" "arm64.nopauth" # "regulator_ignore_unused" # allows for > 30 sec to load msm, at the potential cost of power - - # blacklist graphics in initrd so the firmware can load from disk - "rd.driver.blacklist=msm" ]; initrd = { @@ -91,7 +108,7 @@ in "dispcc_sc8280xp" "phy_qcom_edp" "panel-edp" - # "msm" + "msm" ]; }; }; diff --git a/packages/default.nix b/packages/default.nix index 9e09493..f4a84f7 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -14,12 +14,23 @@ let } ); in -rec { +{ linux_jhovold = pkgs.callPackage linux_x13s_pkg { src = sources.linux-jhovold; version = "6.11.0-rc1"; defconfig = "johan_defconfig"; }; - "x13s/extra-firmware" = pkgs.callPackage ./extra-firmware.nix { }; + graphics-firmware = + let + gpu-src = pkgs.fetchurl { + url = "https://download.lenovo.com/pccbbs/mobiles/n3hdr20w.exe"; + hash = "sha256-Jwyl9uKOnjpwfHd+VaGHjYs9x8cUuRdFCERuXqaJwEY="; + }; + in + pkgs.runCommand "graphics-firmware" { } '' + mkdir -vp "$out/lib/firmware/qcom/sc8280xp/LENOVO/21BX" + ${lib.getExe pkgs.innoextract} ${gpu-src} + cp -v code\$GetExtractPath\$/*/*.mbn "$out/lib/firmware/qcom/sc8280xp/LENOVO/21BX/" + ''; } diff --git a/packages/extra-firmware.nix b/packages/extra-firmware.nix deleted file mode 100644 index 2578627..0000000 --- a/packages/extra-firmware.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ stdenvNoCC, fetchFromGitHub }: - -stdenvNoCC.mkDerivation { - pname = "x13s-extra-firmware"; - version = "1.0.0"; - - src = fetchFromGitHub { - owner = "ironrobin"; - repo = "x13s-alarm"; - rev = "efa51c3b519f75b3983aef67855b1561d9828771"; - sha256 = "sha256-weETbWXz9aL2pDQDKk7fkb1ecQH0qrhUYDs2E5EiJcI="; - }; - - dontFixup = true; - dontBuild = true; - - installPhase = '' - mkdir -p $out/lib/firmware/qcom/sc8280xp/LENOVO/21BX - cp x13s-firmware/qcvss8280.mbn $out/lib/firmware/qcom/sc8280xp/LENOVO/21BX/ - ''; -} From a59ae21e47538cecddadc220ea16a7b8e2485f66 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Tue, 30 Jul 2024 23:24:00 -0400 Subject: [PATCH 13/14] disable non-working iso image --- flake.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/flake.nix b/flake.nix index ad80416..f0ea0ca 100644 --- a/flake.nix +++ b/flake.nix @@ -36,10 +36,6 @@ ]; }; }; - - packages = { - iso = self.nixosConfigurations.iso.config.system.build.isoImage; - }; }; flake.nixosModules.default = import ./module.nix { inherit dtbName; }; From 6218392785894c3c2e148d57a8377adba92abbb3 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Sun, 25 Aug 2024 13:38:05 -0400 Subject: [PATCH 14/14] mark unmaintained --- README.md | 3 +++ module.nix | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 9ec67ab..937bf17 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # nixos x13s +> [!CAUTION] +> This project is unmaintained. + 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. diff --git a/module.nix b/module.nix index f6168bc..61c066a 100644 --- a/module.nix +++ b/module.nix @@ -56,6 +56,13 @@ in }; config = lib.mkIf cfg.enable { + assertions = [ + { + assertion = false; + message = "adamcstephens/nixos-x13s is no longer maintained"; + } + ]; + environment.systemPackages = [ pkgs.efibootmgr ]; hardware.enableAllFirmware = true;