1{ config, pkgs, lib, haskellLib, buildModules, ... }:
3 builder = haskellLib.weakCallPackage pkgs ../builder {
5 ghc = config.ghc.package;
6 compiler-nix-name = config.compiler.nix-name;
7 inherit (config) nonReinstallablePkgs hsPkgs compiler;
13 # This has a slightly modified option type. We will *overwrite* any previous
14 # setting of nonRelocatablePkgs, instead of merging them. Otherwise you
15 # have no chance of removing packages retroactively. We might improve this
16 # by implementing a logic that would allow +xxx to be added, -xxx to be removed
17 # and if it's not a list of -/+ prefixed strings, be assumed to be overwriting.
19 options.nonReinstallablePkgs = lib.mkOption {
20 type = (lib.types.listOf lib.types.str) // {
21 merge = loc: defs: lib.last (lib.getValues defs);
25 options.reinstallableLibGhc = lib.mkOption {
26 type = lib.types.bool;
28 description = "Is lib:ghc reinstallable?";
30 options.setup-depends = lib.mkOption {
31 type = lib.types.listOf lib.types.unspecified;
33 description = "pkgs to globally provide to Setup.hs builds";
36 # Dependencies (with reinstallable-lib:ghc)
38 # .--------. .------------------.
39 # | pretty | < ------- | template-haskell |
40 # '--------' '------------------'
42 # .---------. .-------. |
43 # | deepseq | - > | array | |
44 # '---------' '-------' v
46 # .----------. .----------. .------. .- | ghc-boot-th |
47 # | ghc-heap | | ghc-prim | | base |< -' '-------------'
48 # '----------' '----------' '------' .----------------.
49 # | v | | | integer-simple |
50 # | .-----. | '-- > |-------or-------|
51 # '---- > | rts | < -----' | integer-gmp |
52 # '-----' '----------------'
54 # without reinstallable-lib:ghc, this is significantly larger.
56 config.nonReinstallablePkgs =
57 [ "rts" "ghc-prim" "integer-gmp" "integer-simple" "base"
58 "deepseq" "array" "ghc-boot-th" "pretty" "template-haskell"
59 # ghcjs custom packages
60 "ghcjs-prim" "ghcjs-th"
62 # TODO make this unconditional
64 __elem config.compiler.nix-name ["ghc901" "ghc902" "ghc921" "ghc922" "ghc923"]) [
66 ++ lib.optionals (!config.reinstallableLibGhc) [
68 "ghc" "Cabal" "Win32" "array" "binary" "bytestring" "containers"
69 "directory" "filepath" "ghc-boot" "ghc-compact" "ghc-prim"
72 "mtl" "parsec" "process" "text" "time" "transformers"
73 "unix" "xhtml" "terminfo"
76 ++ lib.optionals (!config.reinstallableLibGhc || __elem config.compiler.nix-name ["ghc865"]) [
80 options.bootPkgs = lib.mkOption {
81 type = lib.types.listOf lib.types.str;
87 ] ++ lib.optional (!config.reinstallableLibGhc) "ghc"
89 __elem config.compiler.nix-name ["ghc901" "ghc902" "ghc921" "ghc922" "ghc923"]) [
92 options.hsPkgs = lib.mkOption {
93 type = lib.types.unspecified;
97 { inherit (builder) shellFor makeConfigFiles ghcWithPackages ghcWithHoogle;
98 buildPackages = buildModules.config.hsPkgs;
101 (name: pkg: if pkg == null then null else builder.build-package config pkg)
102 (config.packages // lib.genAttrs (config.nonReinstallablePkgs ++ config.bootPkgs) (_: null));
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list