Merge pull request #1104 from meatcar/gtk-icons-fix

nix: use wrapGAppsHook to package ghostty
This commit is contained in:
Mitchell Hashimoto
2023-12-16 14:23:08 -08:00
committed by GitHub
3 changed files with 15 additions and 0 deletions

1
.envrc
View File

@ -1,5 +1,6 @@
# If we are a computer with nix-shell available, then use that to setup
# the build environment with exactly what we need.
if has nix; then
watch_file nix/{devShell,package,wraptest}.nix
use flake
fi

View File

@ -31,6 +31,8 @@
glib,
gtk4,
libadwaita,
gnome,
hicolor-icon-theme,
harfbuzz,
libpng,
libGL,
@ -142,4 +144,12 @@ in
# This should be set onto the rpath of the ghostty binary if you want
# it to be "portable" across the system.
LD_LIBRARY_PATH = lib.makeLibraryPath rpathLibs;
# On Linux we need to setup the environment so that all GTK data
# is available (namely icons).
shellHook = lib.optionalString stdenv.isLinux ''
# Minimal subset of env set by wrapGAppsHook4 for icons and global settings
export XDG_DATA_DIRS=$XDG_DATA_DIRS:${hicolor-icon-theme}/share:${gnome.adwaita-icon-theme}/share
export XDG_DATA_DIRS=$XDG_DATA_DIRS:$GSETTINGS_SCHEMAS_PATH # from glib setup hook
'';
}

View File

@ -17,6 +17,8 @@
glib,
gtk4,
libadwaita,
wrapGAppsHook4,
gsettings-desktop-schemas,
git,
ncurses,
pkg-config,
@ -89,6 +91,7 @@ in
ncurses
pkg-config
zig012Hook
wrapGAppsHook4
];
buildInputs =
@ -113,6 +116,7 @@ in
libadwaita
gtk4
glib
gsettings-desktop-schemas
];
dontConfigure = true;