1# Run:
2# nix-build -A nixosTests.activation-lib
3{
4 lib,
5 stdenv,
6 testers,
7}:
8let
9 inherit (lib) fileset;
10
11 runTests = stdenv.mkDerivation {
12 name = "tests-activation-lib";
13 src = fileset.toSource {
14 root = ./.;
15 fileset = fileset.unions [
16 ./lib.sh
17 ./test.sh
18 ];
19 };
20 buildPhase = ":";
21 doCheck = true;
22 postUnpack = ''
23 patchShebangs --build .
24 '';
25 checkPhase = ''
26 ./test.sh
27 '';
28 installPhase = ''
29 touch $out
30 '';
31 };
32
33 runShellcheck = testers.shellcheck {
34 name = "activation-lib";
35 src = runTests.src;
36 };
37
38in
39lib.recurseIntoAttrs {
40 inherit runTests runShellcheck;
41}