ソースを参照

fix: add python3 and cctools to nix build dependencies

node-gyp needs python3 to compile better-sqlite3, and on macOS it also
needs libtool from cctools to create static libraries. Without these,
`nix build` fails in the sandbox.
Paulo Casaretto 3 ヶ月 前
コミット
1033fffca6
1 ファイル変更7 行追加1 行削除
  1. 7 1
      flake.nix

+ 7 - 1
flake.nix

@@ -24,7 +24,13 @@
 
           src = ./.;
 
-          nativeBuildInputs = [ pkgs.bun pkgs.makeWrapper ];
+          nativeBuildInputs = [
+            pkgs.bun
+            pkgs.makeWrapper
+            pkgs.python3  # needed by node-gyp to compile better-sqlite3
+          ] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isDarwin [
+            pkgs.darwin.cctools  # provides libtool needed by node-gyp on macOS
+          ];
 
           buildInputs = [ pkgs.sqlite ];