summary refs log tree commit diff
path: root/pkgs/applications/window-managers/taffybar/default.nix
blob: 7d9e5f9c1cb09975795aea22991a2c1ddc289635 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ lib, stdenv, ghcWithPackages, taffybar, makeWrapper, packages ? (x: []) }:

let
  taffybarEnv = ghcWithPackages (self: [
    self.taffybar
  ] ++ packages self);
in stdenv.mkDerivation {
  name = "taffybar-with-packages-${taffybarEnv.version}";

  nativeBuildInputs = [ makeWrapper ];

  buildCommand = ''
    mkdir -p $out/bin
    makeWrapper ${taffybarEnv}/bin/taffybar $out/bin/taffybar \
      --set NIX_GHC "${taffybarEnv}/bin/ghc"
  '';

  # Trivial derivation
  preferLocalBuild = true;
  allowSubstitutes = false;

  # For hacking purposes
  passthru.env = taffybarEnv;
  buildInputs = [ taffybarEnv ];
  shellHook = "eval $(egrep ^export ${taffybarEnv}/bin/ghc)";

  inherit (taffybar) meta;
}