1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00

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
This commit is contained in:
Robert Helgesson 2025-01-24 19:59:46 +01:00
parent b93e17c73c
commit 1b9fe46e9f
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
5 changed files with 62 additions and 22 deletions

View file

@ -89,12 +89,6 @@
} // (let
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
in {
devShells = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
tests = import ./tests { inherit pkgs; };
in tests.run);
formatter = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in pkgs.linkFarm "format" [{
@ -105,23 +99,12 @@
packages = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
lib = pkgs.lib;
releaseInfo = nixpkgs.lib.importJSON ./release.json;
docs = import ./docs {
inherit pkgs;
inherit (releaseInfo) release isReleaseBranch;
};
hmPkg = pkgs.callPackage ./home-manager { path = "${./.}"; };
testPackages = let
tests = import ./tests { inherit pkgs; };
renameTestPkg = n: lib.nameValuePair "test-${n}";
in lib.mapAttrs' renameTestPkg tests.build;
integrationTestPackages = let
tests = import ./tests/integration { inherit pkgs; };
renameTestPkg = n: lib.nameValuePair "integration-test-${n}";
in lib.mapAttrs' renameTestPkg tests;
in {
default = hmPkg;
home-manager = hmPkg;
@ -129,7 +112,7 @@
docs-html = docs.manual.html;
docs-json = docs.options.json;
docs-manpages = docs.manPages;
} // testPackages // integrationTestPackages);
});
defaultPackage = forAllSystems (system: self.packages.${system}.default);
});