1let f = { hackage, pkgs, pkg-def, pkg-def-extras ? [], modules ? [] }: let
2 buildModules = f { inherit hackage pkg-def pkg-def-extras modules; pkgs = pkgs.buildPackages; };
3in pkgs.lib.evalModules {
6 # Provide all modules with haskellLib, pkgs, and pkgconfPkgs arguments
8 # this is *not* the hasekllLib from nixpkgs; it is rather our own
9 # library from haskell.nix
10 haskellLib = let hl = import ./lib { inherit lib; haskellLib = hl; }; in hl;
12 # The package descriptions depend on pkgs, which are used to resolve system package dependencies
13 # as well as pkgconfPkgs, which are used to resolve pkgconfig name to nixpkgs names. We simply
14 # augment the existing pkgs set with the specific mappings:
15 pkgs = pkgs // (import ./lib/system-nixpkgs-map.nix pkgs);
16 pkgconfPkgs = pkgs // (import ./lib/pkgconf-nixpkgs-map.nix pkgs);
21 # Set the hackage DB for modules/hackage.nix
24 # Set the plan for modules/plan.nix
25 plan.pkg-def = hackage: with builtins;
28 # it is quite combersome to write
29 # (hackage: { packages.x.revision = hackage...;
30 # packages.y.revision = import ./foo.nix; })
31 # where we'd rather write:
32 # (hackage: { x = hackage...; })
35 # As such the desugarer desugars this short hand syntax.
38 isPath = x: builtins.typeOf x == "path";
42 # { package = { ... }; }
43 inject-packages = o: if o ? "packages" then o else { packages = o; };
48 inject-revision = pkg: if pkg ? "revision" then pkg else { revision = pkg; };
50 # x.revision = ./some/path;
52 # x.revision = import ./some/path;
53 expand-paths = pkg: if !(isPath pkg.revision) then pkg else { revision = import pkg.revision; };
54 # apply injection and expansion to the "packages" in extras.
55 in lib.mapAttrs (k: v: if k != "packages"
57 else lib.mapAttrs (_: pkg: (expand-paths (inject-revision pkg))) v)
58 (inject-packages extras);
59 # fold any potential `pkg-def-extras`
62 # This means you can have a base definition (e.g. stackage)
63 # and augment it with custom packages to your liking.
64 in foldl' lib.recursiveUpdate
66 (map (p: desugar (if builtins.isFunction p then p hackage else p)) pkg-def-extras)
74 # Converts config.packages into config.hsPkgs
75 # Replace this with compat-driver.nix to use nixpkgs haskell build infra
76 ./modules/component-driver.nix
78 # Converts config.hackage.db to config.hackage.configs
81 # Converts config.hackage.configs and pkg-def to config.packages
84 # Configuration that applies to all plans
85 ./modules/configuration-nix.nix
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