-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdefault.nix
66 lines (60 loc) · 1.36 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
callPackage,
lib,
stdenv,
nix-gitignore,
makeWrapper,
buildEnv,
dockerTools,
specstrom,
python3,
poetry2nix,
pyright,
chromedriver,
geckodriver,
chromium,
firefox,
includeBrowsers ? true,
}:
let
quickstrom = poetry2nix.mkPoetryApplication {
python = python3;
projectDir = ./.;
src = nix-gitignore.gitignoreSource [
"docs"
"integration-tests"
] ./.;
propagatedBuildInputs = [ specstrom ];
preferWheels = true;
checkPhase = ''
${pyright}/bin/pyright -p . quickstrom tests
pytest
'';
};
client-side = callPackage ./client-side { };
html-report = callPackage ./html-report { };
runtimeDeps =
[ specstrom ]
++ lib.optionals includeBrowsers [
chromedriver
geckodriver
chromium
firefox
];
quickstrom-wrapped = stdenv.mkDerivation {
name = "quickstrom-wrapped";
srcs = ./.;
unpackPhase = false;
buildInputs = [ makeWrapper ];
installPhase = ''
mkdir -p $out/share
cp -r ulib $out/share/ulib
makeWrapper ${quickstrom}/bin/quickstrom $out/bin/quickstrom \
--set QUICKSTROM_CLIENT_SIDE_DIRECTORY ${client-side} \
--set QUICKSTROM_HTML_REPORT_DIRECTORY ${html-report} \
--prefix PATH : ${lib.makeBinPath runtimeDeps} \
--add-flags "-I$out/share/ulib"
'';
};
in
quickstrom-wrapped