-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Expand file tree
/
Copy pathflake.nix
More file actions
56 lines (43 loc) · 1.56 KB
/
Copy pathflake.nix
File metadata and controls
56 lines (43 loc) · 1.56 KB
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
{
description = "career-ops - AI job search pipeline";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flakelight.url = "github:nix-community/flakelight";
};
outputs =
{ flakelight, nixpkgs, ... }:
flakelight ./. {
inputs.nixpkgs = nixpkgs;
# flakelight only exposes its default Linux systems unless `systems` is
# set, so on macOS `nix develop` / direnv fail with a confusing
# "does not provide attribute 'devShells.aarch64-darwin.default'" error.
# List the common dev systems so the devShell resolves on macOS too.
systems = [
"aarch64-darwin"
"x86_64-darwin"
"aarch64-linux"
"x86_64-linux"
];
devShell.packages =
pkgs: with pkgs; [
nodejs
bun
coreutils
playwright-driver.browsers
];
devShell.env = pkgs: {
PLAYWRIGHT_BROWSERS_PATH = "${pkgs.playwright-driver.browsers}";
PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS = "true";
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1";
};
devShell.shellHook = pkgs: ''
# Pin npm playwright to match nixpkgs browser binaries
EXPECTED="${pkgs.playwright-driver.version}"
CURRENT=$(node -e "try{console.log(require('playwright-core/package.json').version)}catch{}" 2>/dev/null)
if [ "$CURRENT" != "$EXPECTED" ]; then
echo "Pinning playwright to $EXPECTED to match Nix-provided browsers..."
npm install --no-save "playwright@$EXPECTED" >/dev/null 2>&1
fi
'';
};
}