Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 1.29 KB | None | 0 0
  1. { nixpkgs ? import <nixpkgs> {}, compiler ? "ghc882", doBenchmark ? false }:
  2.  
  3. let
  4.   pkgs = import (builtins.fetchGit {
  5.     name ="nixos-20.03-small";
  6.     url = https://github.com/nixos/nixpkgs-channels/;
  7.     ref = "nixos-20.03-small";
  8.     rev = "afeaca75cf7bd6510699821202c25cbaf778b1ef";
  9.   }) {};
  10.  
  11.   f = { mkDerivation, base, extra, ghc-lib, ghc-lib-parser
  12.       , hashable, haskell-names, haskell-src-exts, ormolu, stdenv, syb
  13.       , uniplate
  14.       , containers
  15.       , ghc-paths
  16.       , cabal-install
  17.       }:
  18.       mkDerivation {
  19.         pname = "arst";
  20.         version = "0.1";
  21.         src = ./.;
  22.         isLibrary = false;
  23.         isExecutable = true;
  24.         executableHaskellDepends = [
  25.           base extra ghc-lib ghc-lib-parser hashable haskell-names
  26.           haskell-src-exts ormolu syb uniplate
  27.           containers
  28.           ghc-paths
  29.           cabal-install
  30.         ];
  31.         license = stdenv.lib.licenses.mit;
  32.       };
  33.  
  34.   haskellPackages = if compiler == "default"
  35.                        then pkgs.haskellPackages
  36.                        else pkgs.haskell.packages.${compiler};
  37.  
  38.   variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
  39.  
  40.   drv = variant (haskellPackages.callPackage f {});
  41.  
  42. in
  43.  
  44.   if pkgs.lib.inNixShell then drv.env else drv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement