2021-05-20 23:08:51 +00:00
|
|
|
{ lib, stdenv, ghcWithPackages, taffybar, makeWrapper, packages ? (x: []) }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2021-05-20 23:08:51 +00:00
|
|
|
taffybarEnv = ghcWithPackages (self: [
|
|
|
|
self.taffybar
|
|
|
|
] ++ packages self);
|
2020-04-24 23:36:52 +00:00
|
|
|
in stdenv.mkDerivation {
|
2022-03-30 09:31:56 +00:00
|
|
|
pname = "taffybar-with-packages";
|
2022-10-30 15:09:59 +00:00
|
|
|
inherit (taffybar) version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
makeWrapper ${taffybarEnv}/bin/taffybar $out/bin/taffybar \
|
|
|
|
--set NIX_GHC "${taffybarEnv}/bin/ghc"
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +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;
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|