nixpkgs/pkgs/development/idris-modules/default.nix

39 lines
1.1 KiB
Nix
Raw Normal View History

2015-11-27 13:19:50 +00: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;
buildBuiltinPackage = callPackage ./build-builtin-package.nix {};
builtins = pkgs.lib.mapAttrs buildBuiltinPackage {
prelude = [];
base = [ self.prelude ];
contrib = [ self.prelude self.base ];
effects = [ self.prelude self.base ];
pruviloj = [ self.prelude self.base ];
};
2015-11-27 13:19:50 +00:00
in {
inherit idris;
withPackages = callPackage ./with-packages-wrapper.nix {};
buildIdrisPackage = callPackage ./build-idris-package.nix {};
builtins = pkgs.lib.mapAttrsToList (name: value: value) builtins;
} // builtins;
2015-11-27 13:19:50 +00:00
in fix' (extends overrides idrisPackages)