Skip to content

Instantly share code, notes, and snippets.

@freeman42x
Created May 26, 2020 10:49
Show Gist options
  • Save freeman42x/c6b5f6477a5d91e81a6b5f0035040b21 to your computer and use it in GitHub Desktop.
Save freeman42x/c6b5f6477a5d91e81a6b5f0035040b21 to your computer and use it in GitHub Desktop.
How can I update the following so that `nix-shell` will provide `cabal-install` and `ghc` in path when run?
let
ghcVersion = "ghc865";
misoPkgs = import (builtins.fetchTarball {
url = "https://github.com/dmjio/miso/archive/561ffad.tar.gz";
sha256 = "1wwzckz2qxb873wdkwqmx9gmh0wshcdxi7gjwkba0q51jnkfdi41";
}) {};
in
with misoPkgs.pkgs;
with haskell.packages."${ghcVersion}";
let runtimeDeps = [ nwjs ];
app = callCabal2nix "haskell-editor-setup" ./. { miso = miso-jsaddle; };
in
app.overrideAttrs (old: {
miso = miso-jsaddle;
# needs nw in RPATH in order to use propagatedBuildInputs -> useless for runtime
buildInputs = old.buildInputs ++ [ binutils makeWrapper ];
postFixup = ''
mv $out/bin/haskell-editor-setup $out/bin/.haskell-editor-setup-wrapped
makeWrapper $out/bin/.haskell-editor-setup-wrapped $out/bin/haskell-editor-setup \
--prefix PATH : ${lib.makeBinPath runtimeDeps}
'';
})
(import ./default.nix).env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment