@norskvideo/ctl-dev-kit 0.1.17 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/flake.nix +31 -4
- package/package.json +1 -1
package/build/flake.nix
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
description = "norsk-ctl product build + dev shell";
|
|
21
21
|
|
|
22
22
|
inputs = {
|
|
23
|
-
nixpkgs.url = "github:NixOS/nixpkgs/d233902339c02a9c334e7e593de68855ad26c4cb"; # nixpkgs-unstable 2026-05-15, bun 1.3.13
|
|
23
|
+
nixpkgs.url = "github:NixOS/nixpkgs/d233902339c02a9c334e7e593de68855ad26c4cb"; # nixpkgs-unstable 2026-05-15, bun 1.3.13, chromium 148.0.7778.167
|
|
24
24
|
# Biome must match the version pinned in package.json (@biomejs/biome 2.5.5)
|
|
25
25
|
# exactly: 2.4.x can't parse this repo's biome.json (`rules.preset` is a
|
|
26
26
|
# 2.5 key) and any other 2.5.x emits a version-mismatch info that breaks the
|
|
@@ -92,22 +92,49 @@
|
|
|
92
92
|
pkgs.git
|
|
93
93
|
pkgs.ffmpeg # integration suites spawn a local ffmpeg (e.g. SRT egress capture)
|
|
94
94
|
];
|
|
95
|
+
|
|
96
|
+
# Playwright doc-guide browser. nix-pinned headless Chromium needs a
|
|
97
|
+
# real X display on a truly headless box (page.fill silently no-ops on
|
|
98
|
+
# plain HTML inputs; some pages crash the renderer). Ubuntu's apt Xvfb
|
|
99
|
+
# is too old for Chromium 148's input dispatch — the nix xorg-server
|
|
100
|
+
# works. A product's scripts/with-display.sh wraps playwright in
|
|
101
|
+
# xvfb-run iff DISPLAY is unset.
|
|
102
|
+
linuxBrowser = pkgs.lib.optionals pkgs.stdenv.isLinux [
|
|
103
|
+
pkgs.chromium
|
|
104
|
+
pkgs.xvfb-run
|
|
105
|
+
pkgs.xorg.xorgserver
|
|
106
|
+
];
|
|
107
|
+
# Headless Chromium finds no system fonts on NixOS, so text renders at
|
|
108
|
+
# zero advance width — invisible, and every toBeVisible() on text times
|
|
109
|
+
# out. Point fontconfig at a minimal bundled set so glyphs have real
|
|
110
|
+
# metrics.
|
|
111
|
+
fontsConf = pkgs.makeFontsConf {
|
|
112
|
+
fontDirectories = [ pkgs.dejavu_fonts pkgs.liberation_ttf ];
|
|
113
|
+
};
|
|
114
|
+
browserHook = pkgs.lib.optionalString pkgs.stdenv.isLinux ''
|
|
115
|
+
export BROWSER_FOR_TESTING=${pkgs.chromium}/bin/chromium
|
|
116
|
+
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
|
117
|
+
export FONTCONFIG_FILE=${fontsConf}
|
|
118
|
+
'';
|
|
95
119
|
in {
|
|
96
120
|
# Everyday dev shell — build tools + the pinned norsk-ctl daemon.
|
|
97
121
|
# `nix develop` and `nix develop .#dev` are equivalent.
|
|
98
122
|
default = pkgs.mkShell {
|
|
99
123
|
BIOME_BINARY = "${biome}/bin/biome";
|
|
100
|
-
buildInputs = buildTools ++ [ (mkCtl system) ];
|
|
124
|
+
buildInputs = buildTools ++ linuxBrowser ++ [ (mkCtl system) ];
|
|
125
|
+
shellHook = browserHook;
|
|
101
126
|
};
|
|
102
127
|
dev = pkgs.mkShell {
|
|
103
128
|
BIOME_BINARY = "${biome}/bin/biome";
|
|
104
|
-
buildInputs = buildTools ++ [ (mkCtl system) ];
|
|
129
|
+
buildInputs = buildTools ++ linuxBrowser ++ [ (mkCtl system) ];
|
|
130
|
+
shellHook = browserHook;
|
|
105
131
|
};
|
|
106
132
|
# Lean shell for CI (build-image / integration) — no ctl fetch, so
|
|
107
133
|
# image builds never depend on the ctl binary channel.
|
|
108
134
|
build = pkgs.mkShell {
|
|
109
135
|
BIOME_BINARY = "${biome}/bin/biome";
|
|
110
|
-
buildInputs = buildTools;
|
|
136
|
+
buildInputs = buildTools ++ linuxBrowser;
|
|
137
|
+
shellHook = browserHook;
|
|
111
138
|
};
|
|
112
139
|
});
|
|
113
140
|
};
|