hive.nix: Add automatic patching of nixpkgs

This commit is contained in:
Tom Hubrecht 2023-07-02 17:16:17 +02:00
parent da20afa6a6
commit 660a35c7bb

View file

@ -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; };