add overlays and extraPkgConfig support

This commit is contained in:
do butterflies cry? 2026-02-09 09:35:24 +10:00
parent 0a74fb6ac2
commit c233cb88e4
2 changed files with 21 additions and 10 deletions

View file

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

View file

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