Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make icons work #91

Merged
merged 2 commits into from
Dec 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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