2015-11-27 16:19:50 +03:00
|
|
|
{ pkgs, idris, 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.gnome // scope;
|
|
|
|
|
|
|
|
idrisPackages = self: let
|
|
|
|
defaultScope = mkScope self;
|
|
|
|
|
|
|
|
callPackage = callPackageWithScope defaultScope;
|
2015-11-27 17:35:59 +03:00
|
|
|
|
2015-11-27 17:55:22 +03:00
|
|
|
builtins_ = pkgs.lib.mapAttrs self.build-builtin-package {
|
2015-11-27 17:35:59 +03:00
|
|
|
prelude = [];
|
|
|
|
|
|
|
|
base = [ self.prelude ];
|
|
|
|
|
|
|
|
contrib = [ self.prelude self.base ];
|
|
|
|
|
|
|
|
effects = [ self.prelude self.base ];
|
|
|
|
|
|
|
|
pruviloj = [ self.prelude self.base ];
|
|
|
|
};
|
|
|
|
|
2015-11-27 17:57:49 +03:00
|
|
|
files = builtins.filter (n: n != "default") (pkgs.lib.mapAttrsToList (name: type: let
|
2015-11-27 17:55:22 +03:00
|
|
|
m = builtins.match "(.*)\.nix" name;
|
2015-11-27 17:57:49 +03:00
|
|
|
in if m == null then "default" else builtins.head m) (builtins.readDir ./.));
|
2015-11-27 21:17:17 +03:00
|
|
|
in (builtins.listToAttrs (map (name: {
|
|
|
|
inherit name;
|
|
|
|
|
|
|
|
value = callPackage (./. + "/${name}.nix") {};
|
|
|
|
}) files)) // {
|
2015-11-27 17:55:22 +03:00
|
|
|
inherit idris callPackage;
|
2015-11-27 17:35:59 +03:00
|
|
|
|
2015-11-27 21:17:17 +03:00
|
|
|
# A list of all of the libraries that come with idris
|
2015-11-27 17:55:22 +03:00
|
|
|
builtins = pkgs.lib.mapAttrsToList (name: value: value) builtins_;
|
|
|
|
} // builtins_;
|
2015-11-27 16:19:50 +03:00
|
|
|
in fix' (extends overrides idrisPackages)
|