Skip to content

Commit 01804df

Browse files
authored
fix: flake.nix (#7224)
Signed-off-by: Tyler Hardin <th020394@gmail.com>
1 parent a7fb7e1 commit 01804df

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

flake.nix

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,42 @@
4242
version = workspaceToml.workspace.package.version;
4343
src = self;
4444

45-
cargoLock = {
46-
lockFile = ./Cargo.lock;
45+
cargoLock.lockFile = ./Cargo.lock;
46+
47+
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
48+
49+
# Pre-fetch rusty_v8 binary to avoid network access during build
50+
# Map Nix system to rusty_v8 target triple
51+
RUSTY_V8_ARCHIVE = let
52+
cargoLock = builtins.fromTOML (builtins.readFile ./Cargo.lock);
53+
rustyV8Version = (builtins.head (builtins.filter (p: p.name == "v8") cargoLock.package)).version;
54+
rustyV8Target = {
55+
"x86_64-linux" = "x86_64-unknown-linux-gnu";
56+
"aarch64-linux" = "aarch64-unknown-linux-gnu";
57+
"x86_64-darwin" = "x86_64-apple-darwin";
58+
"aarch64-darwin" = "aarch64-apple-darwin";
59+
}.${system} or (throw "Unsupported system: ${system}");
60+
rustyV8Sha256 = {
61+
"x86_64-linux" = "sha256-chV1PAx40UH3Ute5k3lLrgfhih39Rm3KqE+mTna6ysE=";
62+
"aarch64-linux" = "sha256-4IivYskhUSsMLZY97+g23UtUYh4p5jk7CzhMbMyqXyY=";
63+
"x86_64-darwin" = "sha256-1jUuC+z7saQfPYILNyRJanD4+zOOhXU2ac/LFoytwho=";
64+
"aarch64-darwin" = "sha256-yHa1eydVCrfYGgrZANbzgmmf25p7ui1VMas2A7BhG6k=";
65+
}.${system};
66+
in pkgs.fetchurl {
67+
url = "https://github.com/denoland/rusty_v8/releases/download/v${rustyV8Version}/librusty_v8_release_${rustyV8Target}.a.gz";
68+
sha256 = rustyV8Sha256;
4769
};
4870

4971
nativeBuildInputs = with pkgs; [
5072
pkg-config
73+
clang
74+
cmake
5175
];
5276

5377
buildInputs = with pkgs; [
5478
openssl
55-
xorg.libxcb # Required for xcap screenshot functionality
79+
cacert # CA certificates for tests
80+
libxcb # Required for xcap screenshot functionality
5681
dbus # Required for system integration features
5782
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin darwinInputs;
5883

@@ -82,7 +107,7 @@
82107
};
83108
};
84109

85-
devShell = pkgs.mkShell {
110+
devShells.default = pkgs.mkShell {
86111
packages = buildInputs ++ (with pkgs; [
87112
cargo-watch
88113
cargo-edit
@@ -93,7 +118,7 @@
93118
nodejs_24 # 'just' run-ui
94119
ripgrep
95120
rustfmt
96-
xorg.libxcb
121+
libxcb
97122
dbus
98123
yarn # 'just' install-deps
99124
]);

0 commit comments

Comments
 (0)