Skip to content

Commit

Permalink
Make sure that termonad can see GTK icons.
Browse files Browse the repository at this point in the history
This uses wrapGAppsHook to be able to make it so that Termonad can see
the GTK icons it uses.

This is as described in NixOS/nixpkgs#43150.

It appears that hicolor-icon-theme doesn't actually contain any icons,
so instead I'm using adwaita-icon-theme.
  • Loading branch information
cdepillabout committed Dec 27, 2018
1 parent 14902b0 commit 7551a4d
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .nix-helpers/termonad-with-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,28 @@ in
with (import ./nixpkgs.nix { inherit compiler nixpkgs; });

let
ghcWithPackages = haskellPackages.ghcWithPackages;
env = ghcWithPackages (self: [ self.termonad ] ++ extraHaskellPackages self);
env = haskellPackages.ghcWithPackages (self: [
self.termonad
] ++ extraHaskellPackages self);
in

stdenv.mkDerivation {
name = "termonad-with-packages-${env.version}";
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ gnome3.adwaita-icon-theme hicolor-icon-theme ];
nativeBuildInputs = [ wrapGAppsHook ];
preFixup = ''
gappsWrapperArgs+=(
# Thumbnailers (this probably isn't actually needed, but it is a good example of how to use --prefix)
--prefix XDG_DATA_DIRS : "${gdk_pixbuf}/share"
--prefix XDG_DATA_DIRS : "${librsvg}/share"
--prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
--set NIX_GHC "${env}/bin/ghc"
)
'';
buildCommand = ''
mkdir -p $out/bin
makeWrapper ${env}/bin/termonad $out/bin/termonad \
--set NIX_GHC "${env}/bin/ghc"
ln -sf ${env}/bin/termonad $out/bin/termonad
wrapGAppsHook
'';
preferLocalBuild = true;
allowSubstitutes = false;
Expand Down

0 comments on commit 7551a4d

Please sign in to comment.