fix(flake): NixOS build — nativeBuildInputs, wrapGAppsHook3, libayatana-appindicator runtime closure (#1063)

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).
This commit is contained in:
Charles Hakes
2026-04-29 14:29:24 +03:00
committed by GitHub
parent 92f7e996de
commit 37c233d489
+15
View File
@@ -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 = {