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.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;
{ lib, nixpkgs, deploy, devshell }:
tests = callLibs ./tests;
shell = callLibs ./shell;
lib.genAttrs
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
overlays = [
devshell.overlay
(final: prev: {
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 { };

View File

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