From 37c233d4896396255c5b4f80d751285700ad4ce3 Mon Sep 17 00:00:00 2001 From: Charles Hakes Date: Wed, 29 Apr 2026 07:29:24 -0400 Subject: [PATCH] =?UTF-8?q?fix(flake):=20NixOS=20build=20=E2=80=94=20nativ?= =?UTF-8?q?eBuildInputs,=20wrapGAppsHook3,=20libayatana-appindicator=20run?= =?UTF-8?q?time=20closure=20(#1063)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #1092 Four fixes that together make `nix build .#openfang-cli` and `nix build .#openfang-desktop` work on NixOS: 1. perl / clang / pkg-config moved to nativeBuildInputs (fixes openssl-src build failure — this is the bug filed in #1092) 2. openfang-desktop nativeBuildInputs gets pkg-config + wrapGAppsHook3 (GTK runtime wrappers + webkit2gtk-4.1 .pc discovery) 3. libayatana-appindicator added to desktop buildInputs (tray.rs dlopen at runtime) 4. preFixup hook prefixes LD_LIBRARY_PATH so the dlopen-only library actually ends up in the runtime closure Authored by @Aypex. Supersedes #1086 (which only fixed item 1). --- flake.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/flake.nix b/flake.nix index 999cc5c6..1600ae94 100644 --- a/flake.nix +++ b/flake.nix @@ -22,20 +22,35 @@ ... }: { rust-project.src = lib.sources.cleanSource ./.; + rust-project.defaults.perCrate.crane.args.nativeBuildInputs = with pkgs; [ + clang + perl + pkg-config + ]; rust-project.defaults.perCrate.crane.args.buildInputs = with pkgs; [ clang openssl perl pkg-config ]; + rust-project.crates.openfang-desktop.crane.args.nativeBuildInputs = with pkgs; [ + pkg-config + wrapGAppsHook3 + ]; rust-project.crates.openfang-desktop.crane.args.buildInputs = with pkgs; [ atk glib gtk3 + libayatana-appindicator openssl pkg-config webkitgtk_4_1 ]; + rust-project.crates.openfang-desktop.crane.args.preFixup = '' + gappsWrapperArgs+=( + --prefix LD_LIBRARY_PATH : "${pkgs.libayatana-appindicator}/lib" + ) + ''; packages.default = self'.packages.openfang-cli; apps = {