2021-05-12 12:15:17 +00:00
|
|
|
{ lib, stdenv, ghcWithPackages, taffybar, makeWrapper, packages ? (x: []) }:
|
2015-06-30 15:11:43 +00:00
|
|
|
|
|
|
|
let
|
2021-05-12 12:15:17 +00:00
|
|
|
taffybarEnv = ghcWithPackages (self: [
|
2021-05-06 17:54:22 +00:00
|
|
|
self.taffybar
|
|
|
|
] ++ packages self);
|
2015-06-30 15:11:43 +00:00
|
|
|
in stdenv.mkDerivation {
|
2018-07-19 19:49:33 +00:00
|
|
|
name = "taffybar-with-packages-${taffybarEnv.version}";
|
2015-06-30 15:11:43 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
makeWrapper ${taffybarEnv}/bin/taffybar $out/bin/taffybar \
|
|
|
|
--set NIX_GHC "${taffybarEnv}/bin/ghc"
|
|
|
|
'';
|
2016-08-02 16:06:29 +00:00
|
|
|
|
2021-05-12 12:15:17 +00:00
|
|
|
# Trivial derivation
|
|
|
|
preferLocalBuild = true;
|
|
|
|
allowSubstitutes = false;
|
|
|
|
|
|
|
|
# For hacking purposes
|
|
|
|
passthru.env = taffybarEnv;
|
|
|
|
buildInputs = [ taffybarEnv ];
|
|
|
|
shellHook = "eval $(egrep ^export ${taffybarEnv}/bin/ghc)";
|
|
|
|
|
|
|
|
inherit (taffybar) meta;
|
2015-06-30 15:11:43 +00:00
|
|
|
}
|