Added overrideScope for callPackageWith

Consequently removing several ad-hoc definitions of the same concept.
This commit is contained in:
Will Fancher
2017-07-13 14:56:13 -04:00
parent 5a5f8613e0
commit 8b764960e9
4 changed files with 52 additions and 64 deletions
+1 -10
View File
@@ -1,17 +1,8 @@
{ 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.gnome2 // scope;
idrisPackages = self: let
defaultScope = mkScope self;
callPackage = callPackageWithScope defaultScope;
callPackage = callPackageWith (pkgs // pkgs.xorg // pkgs.gnome2 // self);
builtins_ = pkgs.lib.mapAttrs self.build-builtin-package {
prelude = [];