Skip to content

Commit 860863b

Browse files
committed
fix(flake.nix): assert equal playwright version in nix and package.json
Change-Id: I8cc78e842f7d0b1d2a90a4517a186a03636c5559 Signed-off-by: Thomas Kosiewski <tk@coder.com>
1 parent cccdf1e commit 860863b

File tree

4 files changed

+29
-18
lines changed

4 files changed

+29
-18
lines changed

flake.nix

+9
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@
216216
'';
217217
};
218218
in
219+
# "Keep in mind that you need to use the same version of playwright in your node playwright project as in your nixpkgs, or else playwright will try to use browsers versions that aren't installed!"
220+
# - https://nixos.wiki/wiki/Playwright
221+
assert pkgs.lib.assertMsg
222+
(
223+
(pkgs.lib.importJSON ./site/package.json).devDependencies."@playwright/test"
224+
== pkgs.playwright-driver.version
225+
)
226+
"There is a mismatch between the playwright versions in the ./nix.flake and the ./site/package.json file. Please make sure that they use the exact same version.";
219227
rec {
220228
inherit formatter;
221229

@@ -261,6 +269,7 @@
261269

262270
uname = "coder";
263271
homeDirectory = "/home/${uname}";
272+
releaseName = version;
264273

265274
drv = devShells.default.overrideAttrs (oldAttrs: {
266275
buildInputs =

nix/docker.nix

+5-4
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ let
5050
experimental-features = nix-command flakes
5151
'';
5252

53-
etcReleaseName = writeTextDir "etc/coderniximage-release" ''
54-
0.0.0
55-
'';
56-
5753
etcPamdSudoFile = writeText "pam-sudo" ''
5854
# Allow root to bypass authentication (optional)
5955
auth sufficient pam_rootok.so
@@ -115,6 +111,7 @@ let
115111
run ? null,
116112
maxLayers ? 100,
117113
uname ? "nixbld",
114+
releaseName ? "0.0.0",
118115
}:
119116
assert lib.assertMsg (!(drv.drvAttrs.__structuredAttrs or false))
120117
"streamNixShellImage: Does not work with the derivation ${drv.name} because it uses __structuredAttrs";
@@ -207,6 +204,10 @@ let
207204
'';
208205
};
209206

207+
etcReleaseName = writeTextDir "etc/coderniximage-release" ''
208+
${releaseName}
209+
'';
210+
210211
# https://github.com/NixOS/nix/blob/2.8.0/src/libstore/globals.hh#L464-L465
211212
sandboxBuildDir = "/build";
212213

site/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
"@biomejs/biome": "1.9.4",
127127
"@chromatic-com/storybook": "3.2.2",
128128
"@octokit/types": "12.3.0",
129-
"@playwright/test": "1.47.2",
129+
"@playwright/test": "1.47.0",
130130
"@storybook/addon-actions": "8.5.2",
131131
"@storybook/addon-essentials": "8.4.6",
132132
"@storybook/addon-interactions": "8.5.3",

site/pnpm-lock.yaml

+14-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)