From aeb98c7a6bbb663a99b5ccade15243f386597326 Mon Sep 17 00:00:00 2001 From: zhom <2717306+zhom@users.noreply.github.com> Date: Sat, 26 Sep 2026 11:00:31 +0400 Subject: [PATCH] fix: flake build --- flake.nix | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index d5653cd1..ddc8f007 100644 --- a/flake.nix +++ b/flake.nix @@ -15,11 +15,8 @@ }; lib = pkgs.lib; - nodejs = - if pkgs ? nodejs_23 then - pkgs.nodejs_23 - else - pkgs.nodejs_22; + # The version in .node-version; 22 only where 24 is not packaged. + nodejs = pkgs.nodejs_24 or pkgs.nodejs_22; rustPackages = with pkgs; [ cargo @@ -92,10 +89,17 @@ pkgs.pango pkgs.harfbuzz pkgs.webkitgtk_4_1 + pkgs.zlib + ]; + # The .pc files these name in Requires have to resolve too: gdk-3.0 + # requires zlib, and a list of direct dependencies alone left it out, + # so `nix run .#build` failed in gdk-sys. The propagated closure brings + # in everything the listed libraries themselves depend on. + pkgConfigClosure = lib.closePropagation (pkgConfigLibs ++ map lib.getDev pkgConfigLibs); + pkgConfigPath = lib.concatStringsSep ":" [ + (lib.makeSearchPath "lib/pkgconfig" (pkgConfigClosure ++ map lib.getDev pkgConfigClosure)) + (lib.makeSearchPath "share/pkgconfig" pkgConfigClosure) ]; - pkgConfigPath = lib.makeSearchPath "lib/pkgconfig" ( - pkgConfigLibs ++ map lib.getDev pkgConfigLibs - ); releaseVersion = "0.31.2"; releaseAppImage = if system == "x86_64-linux" then @@ -276,6 +280,13 @@ echo "Rust: $(rustc --version)" echo "Cargo: $(cargo --version)" echo "Tauri CLI: $(cargo-tauri --version)" + # Every library the Rust build links through pkg-config, with the + # packages their .pc files require. A gap fails here in seconds + # instead of minutes into `nix run .#build`. + for module in gdk-3.0 webkit2gtk-4.1 javascriptcoregtk-4.1 libsoup-3.0 ayatana-appindicator3-0.1 openssl; do + pkg-config --cflags --libs "$module" > /dev/null + echo "$module: $(pkg-config --modversion "$module")" + done ''; apps.deps = mkApp "donut-deps" ''