1
1
mirror of https://github.com/divnix/digga.git synced 2024-12-26 01:26:23 +03:00

ref: simplify pkgs-lib deps injection

This commit is contained in:
David Arnold 2021-04-18 22:40:53 -05:00
parent 362cc31827
commit 8134350545
No known key found for this signature in database
GPG Key ID: 6D6A936E69C59D08
3 changed files with 14 additions and 20 deletions

View File

@ -1,20 +1,9 @@
args@{ lib, nixpkgs, deploy, devshell }: { lib, nixpkgs, deploy, devshell }:
lib.genAttrs lib.defaultSystems (system:
lib.makeExtensible (final:
let
pkgs = import nixpkgs { inherit system; };
callLibs = file: import file
(args // {
inherit pkgs system;
pkgs-lib = final;
});
in
with final;
{
inherit callLibs;
tests = callLibs ./tests; lib.genAttrs
shell = callLibs ./shell; lib.defaultSystems (system:
{
tests = import ./tests { inherit lib deploy nixpkgs pkgs system; };
shell = import ./shell { inherit lib devshell deploy nixpkgs system; };
} }
) )
)

View File

@ -1,14 +1,17 @@
{ lib, devshell, deploy, system, nixpkgs, ... }: { lib, nixpkgs, devshell, deploy, system }:
let let
overlays = [ overlays = [
devshell.overlay devshell.overlay
(final: prev: { (final: prev: {
deploy-rs = deploy-rs =
deploy.packages.${prev.system}.deploy-rs; deploy.packages.${prev.system}.deploy-rs;
}) })
]; ];
pkgs = lib.os.pkgImport nixpkgs overlays system; pkgs = import nixpkgs { inherit system overlays;; config = {}; };
flk = pkgs.callPackage ./flk.nix { }; flk = pkgs.callPackage ./flk.nix { };

View File

@ -1,5 +1,7 @@
{ pkgs, system, deploy, nixpkgs, lib, ... }: { lib, nixpkgs, deploy, system }:
let let
pkgs = import nixpkgs { inherit system; overlays = []; config = {}; };
mkChecks = { hosts, nodes, homes ? { } }: mkChecks = { hosts, nodes, homes ? { } }:
let let
deployHosts = lib.filterAttrs deployHosts = lib.filterAttrs