From c233cb88e40ae85a4d7c4501692e84c671328684 Mon Sep 17 00:00:00 2001 From: _cry64 Date: Mon, 9 Feb 2026 09:35:24 +1000 Subject: [PATCH] add overlays and extraPkgConfig support --- cerulean/nexus/nexus.nix | 28 ++++++++++++++++++---------- cerulean/nexus/nodes.nix | 3 +++ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/cerulean/nexus/nexus.nix b/cerulean/nexus/nexus.nix index e8c2c95..29c7ad4 100644 --- a/cerulean/nexus/nexus.nix +++ b/cerulean/nexus/nexus.nix @@ -12,8 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. { + self, this, - sys, + nixpkgs, + nixpkgs-unstable, nt, lib, deploy-rs, @@ -33,11 +35,6 @@ mapNodes ; - inherit - (nib.std) - getAttrOr - ; - templateNexus = let inherit (nt.types) @@ -51,6 +48,7 @@ ''); in { groups = missing "an list of all valid node group names." "groups"; + overlays = []; nodes = Terminal {}; }; @@ -80,11 +78,21 @@ [../nixos-module host] ++ node.extraModules; # nix passes these to every single module - specialArgs = + specialArgs = let + pkgConfig = + { + inherit (node) system; + # XXX: WARNING: TODO: i've stopped caring + # XXX: WARNING: TODO: just figure out a better solution to pkgConfig + config.allowUnfree = true; + overlays = self.overlays ++ nexus.overlays ++ node.overlays; + } + // node.extraPkgConfig; + in node.specialArgs // { - pkgs = sys.pkgsFor node.system; - upkgs = sys.upkgsFor node.system; + pkgs = import nixpkgs pkgConfig; + upkgs = import nixpkgs-unstable pkgConfig; }; } ); @@ -143,7 +151,7 @@ }; in { mkNexus = root: outputs': let - autogen = mkNexus' root <| getAttrOr "nexus" {} outputs'; + autogen = mkNexus' root (outputs'.nexus or {}); outputs = removeAttrs outputs' ["nexus"]; in autogen // outputs; # XXX: TODO: replace this with a deep merge diff --git a/cerulean/nexus/nodes.nix b/cerulean/nexus/nodes.nix index d98e1da..b5432de 100644 --- a/cerulean/nexus/nodes.nix +++ b/cerulean/nexus/nodes.nix @@ -29,6 +29,9 @@ in rec { system = "x86_64-linux"; # sane default (i hope...) extraModules = []; specialArgs = Terminal {}; + overlays = []; + # XXX: WARNING: extraPkgConfig is a terrible solution (but im lazy for now) + extraPkgConfig = Terminal {}; deploy = { user = "root";