1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/idris-modules/default.nix

47 lines
1.6 KiB
Nix
Raw Normal View History

{ pkgs, idris-no-deps, overrides ? (self: super: {}) }: let
2015-11-27 13:19:50 +00:00
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;
2015-11-27 13:19:50 +00:00
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 ];
};
2015-11-27 14:57:49 +00:00
files = builtins.filter (n: n != "default") (pkgs.lib.mapAttrsToList (name: type: let
m = builtins.match "(.*)\\.nix" name;
2015-11-27 14:57:49 +00:00
in if m == null then "default" else builtins.head m) (builtins.readDir ./.));
2015-11-27 18:17:17 +00:00
in (builtins.listToAttrs (map (name: {
inherit name;
value = callPackage (./. + "/${name}.nix") {};
}) files)) // {
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]; };
2015-11-27 18:17:17 +00:00
# A list of all of the libraries that come with idris
builtins = pkgs.lib.mapAttrsToList (name: value: value) builtins_;
} // builtins_;
2015-11-27 13:19:50 +00:00
in fix' (extends overrides idrisPackages)