Skip to content

Commit

Permalink
projects: don't apply nixosTest with empty pkgs
Browse files Browse the repository at this point in the history
  • Loading branch information
wegank committed May 16, 2024
1 parent 84712ff commit 52ef767
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions helpers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

ngiPackages = import ./pkgs/by-name {
inherit (pkgs) lib;
inherit callPackage dream2nix pkgs;
inherit dream2nix callPackage pkgs;
};
in
ngiPackages;
Expand All @@ -42,7 +42,7 @@
# Each project includes packages, and optionally, modules, configurations and tests.
importNgiProjects = {pkgs ? {}}: let
ngiProjects = import ./projects {
inherit pkgs;
inherit nixpkgs dream2nix sops-nix pkgs;
};
in
ngiProjects;
Expand Down
5 changes: 4 additions & 1 deletion projects/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
inherit
(lib.attrsets)
mapAttrs
optionalAttrs
recursiveUpdate
filterAttrs
;
Expand Down Expand Up @@ -72,7 +73,9 @@
hydrate = project:
recursiveUpdate
project
{nixos.tests = mapAttrs (_: nixosTest) project.nixos.tests or {};};
(optionalAttrs (pkgs ? nixosTest) {
nixos.tests = mapAttrs (_: nixosTest pkgs) project.nixos.tests or {};
});
in
mapAttrs (
name: type: let
Expand Down

0 comments on commit 52ef767

Please sign in to comment.