Skip to content

Instantly share code, notes, and snippets.

@idontgetoutmuch
Created February 29, 2020 12:05
Show Gist options
  • Save idontgetoutmuch/859100849cba18927e498f9d523a1bc6 to your computer and use it in GitHub Desktop.
Save idontgetoutmuch/859100849cba18927e498f9d523a1bc6 to your computer and use it in GitHub Desktop.
{ pkgs ? import <nixpkgs> { overlays = [ ]; }, doBenchmark ? false }:
let
foo = builtins.fetchGit {
url = "https://github.com/phadej/splitmix";
rev = "fcf2d95181c0d4c39dbaf80cd28b6498f24e5f74";
};
bar = builtins.fetchGit {
url = "https://github.com/idontgetoutmuch/random.git";
rev = "023e812545d2fac849ae64058d64590a63d2fe89";
ref = "avoid-name-clash";
};
f = { mkDerivation, base, random, splitmix, stdenv }:
mkDerivation {
pname = "nix-reverse-deps-of-haskell-package";
version = "0.1.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [ base random splitmix ];
license = stdenv.lib.licenses.bsd3;
};
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
drv = variant (pkgs.haskellPackages.callPackage f { random = bar; splitmix = foo; });
in
if pkgs.lib.inNixShell then drv.env else drv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment