Skip to content

Commit

Permalink
flake/tests: pass testProfile as a shared arg
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAShelf committed May 6, 2024
1 parent c3c76af commit e0b25f6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion flake/tests/checks/homeManagerModule.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
inputs,
nixosTest,
homeManagerModules,
testProfile,
...
}:
nixosTest {
Expand All @@ -10,8 +11,8 @@ nixosTest {

nodes.machine = {
imports = [
testProfile
inputs.home-manager.nixosModules.home-manager
../profiles/minimal.nix
];

config = {
Expand Down
3 changes: 2 additions & 1 deletion flake/tests/checks/nixosModule.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
nixosTest,
nixosModules,
testProfile,
...
}:
nixosTest {
name = "nixos-test";

nodes.machine = {
imports = [
testProfile
nixosModules.nvf
../profiles/minimal.nix
];

config = {
Expand Down
4 changes: 2 additions & 2 deletions flake/tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
defaultInherits = {
inherit (config.flake) homeManagerModules nixosModules;
inherit inputs;
testProfile = ./profiles/minimal.nix;
};

callPackage = callPackageWith (recursiveUpdate pkgs defaultInherits);
in {
checks = packagesFromDirectoryRecursive {
inherit callPackage;
testProfile = ../profiles/minimal.nix;
directory = ./checks;
};

# expose checks as packages to be built
packages = {
test-home-manager-module = self'.checks.homeManagerModule.driverInteractive;
test-nixos-module = self'.checks.nixosModule.driverInteractive;
# test-nixos-module = self'.checks.nixosModule.driverInteractive;
};
};
}

0 comments on commit e0b25f6

Please sign in to comment.