From d84f0810be65ef297662a90cc6466a89e79f7b39 Mon Sep 17 00:00:00 2001 From: Malix - Alix Brunet Date: Fri, 9 Jan 2026 19:19:32 +0100 Subject: [PATCH] enhancement: remove impure `` Co-Authored-By: Jamie Magee Co-Authored-By: Doron Behar --- flake.lock | 19 ++++++++++++++++++- flake.nix | 21 ++++++++++----------- mnt/reform/updateKernelPatches.nix | 10 ++++++---- mnt/reform/updateKernelPatches.sh | 2 +- 4 files changed, 35 insertions(+), 17 deletions(-) diff --git a/flake.lock b/flake.lock index 5999137c..67a1708d 100644 --- a/flake.lock +++ b/flake.lock @@ -1,6 +1,23 @@ { "nodes": { - "root": {} + "nixpkgs": { + "locked": { + "lastModified": 1767892417, + "narHash": "sha256-8bW3q88CEg2u4hSP66Vf4lpbLonHz7hqDNBMcCY7E9U=", + "rev": "3497aa5c9457a9d88d71fa93a4a8368816fbeeba", + "type": "tarball", + "url": "https://releases.nixos.org/nixos/unstable/nixos-26.05pre924538.3497aa5c9457/nixexprs.tar.xz" + }, + "original": { + "type": "tarball", + "url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } }, "root": "root", "version": 7 diff --git a/flake.nix b/flake.nix index 060b14de..8054e8d3 100644 --- a/flake.nix +++ b/flake.nix @@ -1,13 +1,17 @@ { description = "nixos-hardware"; + inputs.nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"; + outputs = - { self, ... }: + { self, nixpkgs, ... }: let # Import private inputs (for development) privateInputs = (import ./tests/flake-compat.nix { - src = ./tests; + src = { + outPath = self.outPath + "/tests"; + }; }).defaultNix; systems = [ @@ -23,17 +27,10 @@ ]; # Helper to iterate over systems - eachSystem = - f: - privateInputs.nixos-unstable-small.lib.genAttrs systems ( - system: f privateInputs.nixos-unstable-small.legacyPackages.${system} system - ); + eachSystem = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system} system); eachSystemFormat = - f: - privateInputs.nixos-unstable-small.lib.genAttrs formatSystems ( - system: f privateInputs.nixos-unstable-small.legacyPackages.${system} system - ); + f: nixpkgs.lib.genAttrs formatSystems (system: f nixpkgs.legacyPackages.${system} system); in { @@ -494,6 +491,8 @@ run-tests = pkgs.callPackage ./tests/run-tests.nix { inherit self; }; + + mnt-reform-kernel-patches = pkgs.callPackage ./mnt/reform/updateKernelPatches.nix { }; } // pkgs.lib.optionalAttrs (system == "aarch64-linux") { # Boot images for NXP i.MX boards (aarch64-linux only) diff --git a/mnt/reform/updateKernelPatches.nix b/mnt/reform/updateKernelPatches.nix index 59d3e4ca..e30bd6f9 100644 --- a/mnt/reform/updateKernelPatches.nix +++ b/mnt/reform/updateKernelPatches.nix @@ -1,9 +1,11 @@ +{ + lib, + fetchFromGitLab, +}: + let - nixpkgs = import { }; - pkgs = nixpkgs.pkgs; - lib = nixpkgs.lib; sources = lib.importJSON ./sources.json; - reformDebianPackages = pkgs.fetchFromGitLab sources.reformDebianPackages; + reformDebianPackages = fetchFromGitLab sources.reformDebianPackages; in map (lib.removePrefix "${reformDebianPackages}/") ( lib.filesystem.listFilesRecursive "${reformDebianPackages}/linux/patches${lib.versions.majorMinor sources.modDirVersion}" diff --git a/mnt/reform/updateKernelPatches.sh b/mnt/reform/updateKernelPatches.sh index 032fc3af..79581c7d 100755 --- a/mnt/reform/updateKernelPatches.sh +++ b/mnt/reform/updateKernelPatches.sh @@ -1,4 +1,4 @@ #!/usr/bin/env sh -nix eval --file updateKernelPatches.nix > kernelPatches.nix +nix eval .#mnt-reform-kernel-patches > kernelPatches.nix nix fmt kernelPatches.nix