1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-09 02:21:05 +01:00
home-manager/tests/flake.nix
Austin Horstman c3297d7721 tests: create no-big and ifd test outputs.
Allows flake access to override easier.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-02 22:58:05 -05:00

82 lines
2.2 KiB
Nix

# 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 =
{ 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;
testAllNoBig =
let
tests = import ./. {
inherit pkgs;
enableBig = false;
};
in
lib.nameValuePair "test-all-no-big" tests.build.all;
testAllNoBigIfd =
let
tests = import ./. {
inherit pkgs;
enableBig = false;
enableLegacyIfd = true;
};
in
lib.nameValuePair "test-all-no-big-ifd" tests.build.all;
in
testPackages
// integrationTestPackages
// (lib.listToAttrs [
testAllNoBig
testAllNoBigIfd
])
);
};
}