-
Notifications
You must be signed in to change notification settings - Fork 5
/
flake.nix
52 lines (46 loc) · 1.52 KB
/
flake.nix
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
{
inputs = {
nixpkgs.url = "nixpkgs";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, rust-overlay }:
let
overlays = [ rust-overlay.overlays.default ];
pkgs = import nixpkgs {
system = "aarch64-darwin";
inherit overlays;
};
pkgsX86 = import nixpkgs {
system = "x86_64-darwin";
inherit overlays;
};
rustToolchainExtensions = [ "rust-src" "rust-analyzer" "clippy" ];
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
targets = [ "aarch64-apple-darwin" ];
extensions = rustToolchainExtensions;
};
rustToolchainX86 = pkgsX86.rust-bin.stable.latest.default.override {
targets = [ "x86_64-apple-darwin" ];
extensions = rustToolchainExtensions;
};
buildInputs = p: with p; [ apple-sdk_12 ];
commonPackages = p: with p; [ cargo-tauri nodejs_22 corepack_22 bacon ];
in {
devShells = {
aarch64-darwin.default = pkgs.mkShellNoCC {
buildInputs = buildInputs pkgs;
packages = [ rustToolchain ] ++ (commonPackages pkgs);
shellHook = ''
echo "=== 🛠️ DEV SHELL (APPLE SILICON) ==="
'';
};
x86_64-darwin.default = pkgsX86.mkShellNoCC {
buildInputs = buildInputs pkgsX86;
packages = [ rustToolchainX86 ] ++ (commonPackages pkgsX86);
shellHook = ''
echo "=== 🛠️ DEV SHELL (APPLE ROSETTA) ==="
'';
};
};
};
}