diff options
author | Shea Levy <shea@shealevy.com> | 2015-11-27 09:55:22 -0500 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2015-11-27 09:55:22 -0500 |
commit | a5ca796f557f74e23328c8892447b0606d333f8d (patch) | |
tree | e9a673bb78c667ffe027cf6bad972bb82f656bcd /pkgs/development/idris-modules | |
parent | efbee054fd2dca2b14c729cf73aca7246c56d9f2 (diff) |
idris-modules: Read the filesystem to populate package list
Diffstat (limited to 'pkgs/development/idris-modules')
-rw-r--r-- | pkgs/development/idris-modules/build-builtin-package.nix | 2 | ||||
-rw-r--r-- | pkgs/development/idris-modules/default.nix | 18 | ||||
-rw-r--r-- | pkgs/development/idris-modules/with-packages.nix (renamed from pkgs/development/idris-modules/with-packages-wrapper.nix) | 0 |
3 files changed, 9 insertions, 11 deletions
diff --git a/pkgs/development/idris-modules/build-builtin-package.nix b/pkgs/development/idris-modules/build-builtin-package.nix index 9a6b99d15230..7445e95e27c0 100644 --- a/pkgs/development/idris-modules/build-builtin-package.nix +++ b/pkgs/development/idris-modules/build-builtin-package.nix @@ -1,4 +1,4 @@ -{ idris, buildIdrisPackage }: name: deps: buildIdrisPackage (args: { +{ idris, build-idris-package }: name: deps: build-idris-package (args: { inherit name; propagatedBuildInputs = deps; diff --git a/pkgs/development/idris-modules/default.nix b/pkgs/development/idris-modules/default.nix index 96e8b5b8ad9d..8388eb96bbf3 100644 --- a/pkgs/development/idris-modules/default.nix +++ b/pkgs/development/idris-modules/default.nix @@ -13,9 +13,7 @@ callPackage = callPackageWithScope defaultScope; - buildBuiltinPackage = callPackage ./build-builtin-package.nix {}; - - builtins = pkgs.lib.mapAttrs buildBuiltinPackage { + builtins_ = pkgs.lib.mapAttrs self.build-builtin-package { prelude = []; base = [ self.prelude ]; @@ -26,13 +24,13 @@ pruviloj = [ self.prelude self.base ]; }; - in { - inherit idris; - - withPackages = callPackage ./with-packages-wrapper.nix {}; - buildIdrisPackage = callPackage ./build-idris-package.nix {}; + files = builtins.filter (n: n != null) (pkgs.lib.mapAttrsToList (name: type: let + m = builtins.match "(.*)\.nix" name; + in if m == null then null else builtins.head m) (builtins.readDir ./.)); + in (builtins.listToAttrs (map (name: { inherit name; value = callPackage (./. + "/${name}.nix") {}; }) files)) // { + inherit idris callPackage; - builtins = pkgs.lib.mapAttrsToList (name: value: value) builtins; - } // builtins; + builtins = pkgs.lib.mapAttrsToList (name: value: value) builtins_; + } // builtins_; in fix' (extends overrides idrisPackages) diff --git a/pkgs/development/idris-modules/with-packages-wrapper.nix b/pkgs/development/idris-modules/with-packages.nix index f8abe09fe877..f8abe09fe877 100644 --- a/pkgs/development/idris-modules/with-packages-wrapper.nix +++ b/pkgs/development/idris-modules/with-packages.nix |