-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
77 lines (70 loc) · 2.21 KB
/
Copy pathflake.nix
File metadata and controls
77 lines (70 loc) · 2.21 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
description = "development environment for ping-sdk repository";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-darwin.url = "github:NixOS/nixpkgs/nixpkgs-26.05-darwin";
};
outputs =
{ self, nixpkgs, nixpkgs-darwin }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
pkgsFor =
system:
let
nixpkgsInput =
if nixpkgs.lib.hasSuffix "darwin" system then nixpkgs-darwin else nixpkgs;
in
import nixpkgsInput { inherit system; };
in
{
devShells = forAllSystems (
system:
let
pkgs = pkgsFor system;
playwrightBrowsers = pkgs.playwright-driver.browsers;
in
{
default = pkgs.mkShell {
buildInputs = with pkgs; [
nodejs_24
# package.json pins pnpm@10.21.0; nixpkgs provides 10.34.5 (latest pnpm_10)
pkgs.pnpm_10
git
nixpkgs-fmt
nil
];
env = {
PLAYWRIGHT_BROWSERS_PATH = "${playwrightBrowsers}";
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1";
};
shellHook = ''
echo "──────────────────────────────────────"
echo " ping-sdk dev environment"
echo " node $(node --version)"
echo " pnpm $(pnpm --version)"
echo " git $(git --version | cut -d' ' -f3)"
echo " playwright browsers: $PLAYWRIGHT_BROWSERS_PATH"
echo "──────────────────────────────────────"
'';
};
}
);
packages = forAllSystems (
system:
let
pkgs = pkgsFor system;
in
{
default = self.devShells.${system}.default;
playwright-browsers = pkgs.playwright-driver.browsers;
}
);
formatter = forAllSystems (system: (pkgsFor system).nixpkgs-fmt);
};
}