-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
84 lines (82 loc) · 2.13 KB
/
flake.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
description = "Provides nix derivations for playwright browsers in various versions";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
let
versions = [
"v1_47_0"
"v1_46_0"
"v1_45_1"
"v1_45_0"
"v1_44_0"
"v1_43_0"
"v1_42_0"
# Versions older than 1.41.0 don't seem to build. PRs welcome if you need them, but I think
# most people are more interested in the recent ones.
# "v1_41_2"
# "v1_41_1"
# "v1_41_0"
# "v1_40_0"
# "v1_39_0"
# "v1_38_0"
# "v1_37_0"
# "v1_36_0"
# "v1_35_0"
# "v1_34_0"
# "v1_33_0"
# "v1_32_1"
# "v1_32_0"
# "v1_31_1"
# "v1_31_0"
# "v1_30_0"
# "v1_29_1"
# "v1_29_0"
# "v1_28_0"
# "v1_27_1"
# "v1_27_0"
# "v1_26_1"
# "v1_26_0"
];
inherit (builtins) listToAttrs;
inherit (nixpkgs.lib) genAttrs;
in
flake-utils.lib.eachDefaultSystem (system: {
overlays = {
default = (
final: prev:
listToAttrs (
map (version: {
name = "playwright-browsers_${version}";
value = final.callPackage self.recipes.${version} { };
}) versions
)
);
};
packages =
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.${system}.default ];
};
in
genAttrs (map (v: "playwright-browsers_${v}") versions) (version: pkgs.${version});
})
// {
recipes = genAttrs versions (
version:
# Wrapping callPackages stuff turned out to be a bit more tricky than I expected, but
# I think this is working. If this causes issues, we can always just edit the generated
# files.
args@{ callPackage, ... }:
(callPackage ./${version}/driver.nix args).playwright-core.browsers
);
};
}