Skip to content

Commit

Permalink
Merge pull request #91 from cdepillabout/make-icons-work
Browse files Browse the repository at this point in the history
Make icons work
  • Loading branch information
cdepillabout authored Dec 27, 2018
2 parents 14902b0 + bd978d8 commit 9e89146
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
13 changes: 9 additions & 4 deletions .nix-helpers/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let
src =
builtins.filterSource
(path: type: with stdenvLib;
! elem (baseNameOf path) [ ".git" "result" ".stack-work" ] &&
! elem (baseNameOf path) [ ".git" "result" ".stack-work" ".nix-helpers" ] &&
! any (flip hasPrefix (baseNameOf path)) [ "dist" ".ghc" ]
)
./..;
Expand Down Expand Up @@ -55,14 +55,19 @@ let
};
in callCabal2nix "focuslist" src {};

haskellPackagesOL = self: super: with super.haskell.lib; {
haskellPackagesOverlay = self: super: with super.haskell.lib; {
haskellPackages = super.haskell.packages.${compilerVersion}.override {
overrides = hself: hsuper: {
# Only override the version of foculist if it doesn't already exist in
# the haskell package set.
focuslist = hsuper.focuslist or (myfocuslist hself.callCabal2nix);

termonad = termonadOverride self.stdenv.lib self.gnome3 hself.callCabal2nix self.haskell.lib.overrideCabal;
termonad =
termonadOverride
self.stdenv.lib
self.gnome3
hself.callCabal2nix
self.haskell.lib.overrideCabal;

# This is a tool to use to easily open haddocks in the browser.
open-haddock = hsuper.open-haddock.overrideAttrs (oa: {
Expand All @@ -87,5 +92,5 @@ let
});
};

in import nixpkgsSrc { overlays = [ haskellPackagesOL ]; }
in import nixpkgsSrc { overlays = [ haskellPackagesOverlay ]; }

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 9e89146

Please sign in to comment.