Skip to content

Instantly share code, notes, and snippets.

@idontgetoutmuch
Created February 26, 2020 17:42
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 idontgetoutmuch/b02458d0a22f23d6c9acf5c2fa794e75 to your computer and use it in GitHub Desktop.
Save idontgetoutmuch/b02458d0a22f23d6c9acf5c2fa794e75 to your computer and use it in GitHub Desktop.
let
myHaskellPackageOverlay = self: super: {
haskellPackages = super.haskellPackages.override {
overrides = hself: hsuper: {
random =
let newRandomSrc = builtins.fetchGit {
url = "file:///Users/dom/random";
rev = "85a6dd013283437c05ab99498fc2f7351d5c504a";
ref = "interface-to-performance";
};
in
# Since cabal2nix has a transitive dependency on random, we need to
# get the callCabal2nix function from the normal haskellPackages that
# is not being overridden.
(import <nixpkgs> {}).haskell.lib.dontCheck ((import <nixpkgs> {}).haskellPackages.callCabal2nix "random" newRandomSrc { });
};
};
};
noCheckOvelay = self: super: {
mkDerivation = args: super.mkDerivation (args // {
doCheck = false;
});
};
activeOverlays = [ noCheckOvelay ];
foo = builtins.foldl' (pkgs: overlay: pkgs.extend overlay) nixpkgs.haskellPackages activeOverlays;
nixpkgs = import <nixpkgs> { overlays = [ myHaskellPackageOverlay ]; };
in
# This example derivation file is assumed to be in the current directory. "./default.nix" is
# the current file you are looking at.
import ./default.nix {
reverseDepsOf = "random";
inherit nixpkgs;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment