Skip to content

Instantly share code, notes, and snippets.

@yorickvP
Created July 19, 2019 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yorickvP/3526c8b60de0c923cb11d1a20e975c18 to your computer and use it in GitHub Desktop.
Save yorickvP/3526c8b60de0c923cb11d1a20e975c18 to your computer and use it in GitHub Desktop.
let
all-cabal-hashes-component = name: version: type:
builtins.fetchurl
"https://raw.githubusercontent.com/commercialhaskell/all-cabal-hashes/hackage/${name}/${version}/${name}.${type}";
in self: super: {
haskellPackages = super.haskellPackages.override {
overrides = self: super: {
hackage2nix = name: version:
self.haskellSrc2nix {
name = "${name}-${version}";
sha256 = ''
$(sed -e 's/.*"SHA256":"//' -e 's/".*$//' "${
all-cabal-hashes-component name version "json"
}")'';
src = all-cabal-hashes-component name version "cabal";
};
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment