summary refs log tree commit diff
path: root/pkgs/development/idris-modules/default.nix
blob: 35ee20e962244b08a819af5e398c1d4a453203a8 (plain) (blame)
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
{ pkgs, idris-no-deps, overrides ? (self: super: {}) }: let
  inherit (pkgs.lib) callPackageWith fix' extends;

  /* Taken from haskell-modules/default.nix, should probably abstract this away */
  callPackageWithScope = scope: drv: args: (callPackageWith scope drv args) // {
    overrideScope = f: callPackageWithScope (mkScope (fix' (extends f scope.__unfix__))) drv args;
  };

  mkScope = scope : pkgs // pkgs.xorg // pkgs.gnome2 // scope;

  idrisPackages = self: let
    defaultScope = mkScope self;

    callPackage = callPackageWithScope defaultScope;

    builtins_ = pkgs.lib.mapAttrs self.build-builtin-package {
      prelude = [];

      base = [ self.prelude ];

      contrib = [ self.prelude self.base ];

      effects = [ self.prelude self.base ];

      pruviloj = [ self.prelude self.base ];
    };

  in
    {
    inherit idris-no-deps callPackage;
    # See #10450 about why we have to wrap the executable
    idris =
        (pkgs.callPackage ./idris-wrapper.nix {})
          idris-no-deps
          { path = [ pkgs.gcc ]; lib = [pkgs.gmp]; };


    with-packages = callPackage ./with-packages.nix {} ;

    build-builtin-package = callPackage ./build-builtin-package.nix {};

    build-idris-package = callPackage ./build-idris-package.nix {};

    # Libraries

    # A list of all of the libraries that come with idris
    builtins = pkgs.lib.mapAttrsToList (name: value: value) builtins_;

    httpclient = callPackage ./httpclient.nix {};

    lightyear = callPackage ./lightyear.nix {};

    optparse = callPackage ./optparse.nix {};

    wl-pprint = callPackage ./wl-pprint.nix {};

    specdris = callPackage ./specdris.nix {};


  } // builtins_;
in fix' (extends overrides idrisPackages)