From 660a35c7bbf4f9ffe24e0a59dd909bf25d5bfc3d Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Sun, 2 Jul 2023 17:16:17 +0200 Subject: [PATCH] hive.nix: Add automatic patching of nixpkgs --- hive.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hive.nix b/hive.nix index 318fac3..421915e 100644 --- a/hive.nix +++ b/hive.nix @@ -18,10 +18,18 @@ let inherit (metadata.nodes.${node}) deployment; }; - mkNixpkgs = node: import sources."nixos-${metadata.nodes.${node}.nixpkgs}" { }; + mkNixpkgs = node: + let version = "nixos-${metadata.nodes.${node}.nixpkgs}"; in + (import sources.${version} { }).applyPatches { + name = "${version}-patched"; + src = sources.${version}; + patches = (import ./nix-patches).${version} or [ ]; + }; + + mkNixpkgs' = node: import (mkNixpkgs node) { }; mkArgs = node: { - dgn-lib = import ./lib { inherit ((mkNixpkgs node)) lib; }; + dgn-lib = import ./lib { inherit ((mkNixpkgs' node)) lib; }; }; nodes = builtins.attrNames metadata.nodes; @@ -29,7 +37,7 @@ in { meta = { - nodeNixpkgs = lib.mapSingleFuse mkNixpkgs nodes; + nodeNixpkgs = lib.mapSingleFuse mkNixpkgs' nodes; specialArgs = { inherit sources; meta = metadata; };