forked from youngkidwarrior/sendapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
107 lines (100 loc) · 3.34 KB
/
flake.nix
File metadata and controls
107 lines (100 loc) · 3.34 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
description = "Send.app development environment";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
foundry-overlay.url = "github:0xbigboss/foundry-overlay";
bun-overlay.url = "github:0xbigboss/bun-overlay";
# Used for shell.nix
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
flake-utils,
foundry-overlay,
bun-overlay,
...
} @ inputs: let
overlays = [
foundry-overlay.overlays.default
bun-overlay.overlays.default
(final: prev: {
unstable = import nixpkgs-unstable {
inherit (prev) system;
overlays = [
foundry-overlay.overlays.default
bun-overlay.overlays.default
];
config = {
allowUnfree = true;
};
};
})
];
# Our supported systems are the same as foundry-overlay
systems = ["x86_64-linux" "x86_64-darwin" "aarch64-darwin"];
in
flake-utils.lib.eachSystem systems (
system: let
pkgs = import nixpkgs {
inherit overlays system;
config = {
allowUnfree = true; # Allow unfree packages like Xcode
};
};
in {
formatter = pkgs.alejandra;
devShells.default = pkgs.mkShell {
name = "sendapp-dev";
nativeBuildInputs =
[
pkgs.foundry
pkgs.python310
pkgs.gnused
pkgs.postgresql_15
pkgs.bun
pkgs.unstable.fnm
pkgs.unstable.jq
pkgs.unstable.yj
pkgs.unstable.tilt
pkgs.unstable.temporal-cli
pkgs.unstable.ripgrep
pkgs.unstable.watchman
pkgs.unstable.maestro
]
++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [
# Playwright browser drivers (Linux only)
pkgs.unstable.playwright-driver.browsers
];
shellHook =
''
eval "$(fnm env --use-on-cd --corepack-enabled --shell bash)"
echo "Welcome to the Send.app development environment!"
''
+ (pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isDarwin ''
# On macOS, we unset the macOS SDK env vars that Nix sets up because
# we rely on a system installation. Nix only provides a macOS SDK
# and we need iOS too.
unset SDKROOT
unset DEVELOPER_DIR
# We need to add the system Xcode tools to the PATH so that expo works correctly
export PATH=/usr/bin:$PATH
'')
+ (pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isLinux ''
# Set up Playwright environment variables for Linux
export PLAYWRIGHT_BROWSERS_PATH=${pkgs.unstable.playwright-driver.browsers}
# may need to set this if encountering validation errors
# export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true
'');
};
# For compatibility with older versions of the `nix` binary
devShell = self.devShells.${system}.default;
}
);
}