mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-22 17:31:04 +03:00
41 lines
642 B
Nix
41 lines
642 B
Nix
![]() |
# Run:
|
||
|
# nix-build -A nixosTests.activation-lib
|
||
|
{
|
||
|
lib,
|
||
|
stdenv,
|
||
|
testers,
|
||
|
}:
|
||
|
let
|
||
|
inherit (lib) fileset;
|
||
|
|
||
|
runTests = stdenv.mkDerivation {
|
||
|
name = "tests-activation-lib";
|
||
|
src = fileset.toSource {
|
||
|
root = ./.;
|
||
|
fileset = fileset.unions [
|
||
|
./lib.sh
|
||
|
./test.sh
|
||
|
];
|
||
|
};
|
||
|
buildPhase = ":";
|
||
|
doCheck = true;
|
||
|
postUnpack = ''
|
||
|
patchShebangs --build .
|
||
|
'';
|
||
|
checkPhase = ''
|
||
|
./test.sh
|
||
|
'';
|
||
|
installPhase = ''
|
||
|
touch $out
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
runShellcheck = testers.shellcheck {
|
||
|
src = runTests.src;
|
||
|
};
|
||
|
|
||
|
in
|
||
|
lib.recurseIntoAttrs {
|
||
|
inherit runTests runShellcheck;
|
||
|
}
|