diff --git a/.envrc b/.envrc index 7ee2b88b4..c57ee1c4f 100644 --- a/.envrc +++ b/.envrc @@ -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 diff --git a/nix/devShell.nix b/nix/devShell.nix index 1c03c6a6c..00418c0a8 100644 --- a/nix/devShell.nix +++ b/nix/devShell.nix @@ -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 + ''; } diff --git a/nix/package.nix b/nix/package.nix index 734aa3b85..fccb0a143 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -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;