-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
42 lines (35 loc) · 1.42 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }:
let
inherit (nixpkgs) pkgs;
f = { mkDerivation, applicative-quoters, attoparsec, base
, basic-prelude, containers, errors, exceptions, HUnit, lens, mtl
, optparse-applicative, pretty, pretty-show, shelly, stdenv
, system-filepath, test-framework, test-framework-hunit, text
, th-printf, unix
}:
mkDerivation {
pname = "nix-env-rebuild";
version = "0.2.1.0";
src = ./.;
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
applicative-quoters attoparsec base basic-prelude containers errors
exceptions lens mtl optparse-applicative pretty pretty-show shelly
system-filepath text th-printf unix
];
testHaskellDepends = [
applicative-quoters attoparsec base basic-prelude containers errors
exceptions HUnit lens mtl optparse-applicative pretty pretty-show
shelly system-filepath test-framework test-framework-hunit text
th-printf unix
];
description = "Declarative management of the Nix user environment";
license = "GPL";
};
haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};
drv = haskellPackages.callPackage f {};
in
if pkgs.lib.inNixShell then drv.env else drv