-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
home-manager: move tests into new test flake
Having the tests available in the main Nix Flake introduces unnecessary evaluation for non-developer users and, worse, a dependency on the nmt library. Fixes #6354
- Loading branch information
Showing
5 changed files
with
62 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# This is an internal Nix Flake intended for use when running tests. | ||
# | ||
# You can build all tests or specific tests by running | ||
# | ||
# nix build --reference-lock-file flake.lock ./tests#test-all | ||
# nix build --reference-lock-file flake.lock ./tests#test-alacritty-empty-settings | ||
# | ||
# in the Home Manager project root directory. | ||
# | ||
# Similarly for integration tests | ||
# | ||
# nix build --reference-lock-file flake.lock ./tests#integration-test-all | ||
# nix build --reference-lock-file flake.lock ./tests#integration-test-standalone-standard-basics | ||
|
||
{ | ||
description = "Tests of Home Manager for Nix"; | ||
|
||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
|
||
outputs = { self, nixpkgs, ... }: | ||
let forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed; | ||
in { | ||
devShells = forAllSystems (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
tests = import ./. { inherit pkgs; }; | ||
in tests.run); | ||
|
||
packages = forAllSystems (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
lib = pkgs.lib; | ||
|
||
testPackages = let | ||
tests = import ./. { inherit pkgs; }; | ||
renameTestPkg = n: lib.nameValuePair "test-${n}"; | ||
in lib.mapAttrs' renameTestPkg tests.build; | ||
|
||
integrationTestPackages = let | ||
tests = import ./integration { inherit pkgs; }; | ||
renameTestPkg = n: lib.nameValuePair "integration-test-${n}"; | ||
in lib.mapAttrs' renameTestPkg tests; | ||
in testPackages // integrationTestPackages); | ||
}; | ||
} |