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

tests: move package to its own file

Extract the `tests` package from `flake.nix`  into its own file
`tests/package.nix`.

This a) de-couples it from the flake (to a degree) and b) allows more
neatly using the callPackage pattern.
This commit is contained in:
Matt Sturgeon 2025-11-01 10:30:15 +00:00 committed by Austin Horstman
parent 4ac96eb21c
commit 5fb2203af7
2 changed files with 9 additions and 3 deletions

View file

@ -80,9 +80,7 @@
./modules/misc/news/create-news-entry.sh ./modules/misc/news/create-news-entry.sh
''; '';
tests = pkgs.writeShellScriptBin "tests" '' tests = pkgs.callPackage ./tests/package.nix { flake = self; };
exec ${pkgs.python3}/bin/python3 ${self}/tests/tests.py "$@"
'';
docs-html = docs.manual.html; docs-html = docs.manual.html;
docs-htmlOpenTool = docs.manual.htmlOpenTool; docs-htmlOpenTool = docs.manual.htmlOpenTool;

8
tests/package.nix Normal file
View file

@ -0,0 +1,8 @@
{
flake,
python3,
writeShellScriptBin,
}:
writeShellScriptBin "tests" ''
exec ${python3}/bin/python3 ${flake}/tests/tests.py "$@"
''