|
42 | 42 | version = workspaceToml.workspace.package.version; |
43 | 43 | src = self; |
44 | 44 |
|
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; |
47 | 69 | }; |
48 | 70 |
|
49 | 71 | nativeBuildInputs = with pkgs; [ |
50 | 72 | pkg-config |
| 73 | + clang |
| 74 | + cmake |
51 | 75 | ]; |
52 | 76 |
|
53 | 77 | buildInputs = with pkgs; [ |
54 | 78 | openssl |
55 | | - xorg.libxcb # Required for xcap screenshot functionality |
| 79 | + cacert # CA certificates for tests |
| 80 | + libxcb # Required for xcap screenshot functionality |
56 | 81 | dbus # Required for system integration features |
57 | 82 | ] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin darwinInputs; |
58 | 83 |
|
|
82 | 107 | }; |
83 | 108 | }; |
84 | 109 |
|
85 | | - devShell = pkgs.mkShell { |
| 110 | + devShells.default = pkgs.mkShell { |
86 | 111 | packages = buildInputs ++ (with pkgs; [ |
87 | 112 | cargo-watch |
88 | 113 | cargo-edit |
|
93 | 118 | nodejs_24 # 'just' run-ui |
94 | 119 | ripgrep |
95 | 120 | rustfmt |
96 | | - xorg.libxcb |
| 121 | + libxcb |
97 | 122 | dbus |
98 | 123 | yarn # 'just' install-deps |
99 | 124 | ]); |
|
0 commit comments