summaryrefslogtreecommitdiffstats
path: root/lib/eval-source.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2017-07-12 19:11:29 +0200
committerlassulus <lassulus@lassul.us>2017-07-12 19:11:29 +0200
commitf5328676c347a2785d2084628ba40448ec2680e8 (patch)
tree06046d7a2eed347cdd97a6bc81d6299500a3137f /lib/eval-source.nix
parented9aca322dbcd2fa0484edb22076a56f49781d75 (diff)
parentb4d3d6c7ab2ff197b6dc47f366f698fceeb88242 (diff)
Merge branch 'staging/source'
Diffstat (limited to 'lib/eval-source.nix')
-rw-r--r--lib/eval-source.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/eval-source.nix b/lib/eval-source.nix
new file mode 100644
index 0000000..468fc92
--- /dev/null
+++ b/lib/eval-source.nix
@@ -0,0 +1,15 @@
+with import <stockholm/lib>;
+let
+ eval = _file: source: evalModules {
+ modules = singleton {
+ inherit _file;
+ imports = map (source: { inherit source; }) (toList source);
+ options.source = mkOption {
+ type = types.attrsOf types.source;
+ default = {};
+ };
+ };
+ };
+in
+ # This function's return value can be used as pkgs.populate input.
+ _file: source: (eval _file source).config.source