-
Notifications
You must be signed in to change notification settings - Fork 244
/
Copy pathdefault.nix
62 lines (53 loc) · 1.28 KB
/
default.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{ stdenv
, lib
, fetchFromGitHub
, cabalProject'
, haskellLib
, recurseIntoAttrs
, compiler-nix-name
, evalPackages
, ...
}:
let
project = cabalProject' {
inherit compiler-nix-name evalPackages;
src = fetchFromGitHub {
owner = "ekmett";
repo = "unpacked-containers";
rev = "7dc56993a57511b58257b5d389473e638a7082d2";
hash = "sha256-BBsTF7H4jdZk/huvsoQWNkR3GTNgZy8mqs76pKG4Mu4=";
};
cabalProjectLocal = ''
allow-newer:
, unpacked-containers:*
, unpacked-unordered-containers:*
'';
};
packages = haskellLib.selectProjectPackages project.hsPkgs;
components = lib.concatMap haskellLib.getAllComponents (lib.attrValues packages);
in
recurseIntoAttrs {
ifdInputs = {
plan-nix = lib.addMetaAttrs
{
platforms = lib.platforms.all;
# Making this work for cross compilers will be difficult.
disabled = stdenv.buildPlatform != stdenv.hostPlatform;
}
project.plan-nix;
};
run = stdenv.mkDerivation {
name = "backpack-test";
buildCommand = ''
printf ${lib.concatStringsSep " " components}
touch $out
'';
meta = {
platforms = lib.platforms.all;
};
passthru = {
# Used for debugging with nix repl
inherit project packages;
};
};
}