summaryrefslogtreecommitdiffstats
path: root/lib/eval-source.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2017-07-06 21:47:47 +0200
committertv <tv@krebsco.de>2017-07-10 11:05:48 +0200
commit7fdc46bb9d911838edfa723d985ede6a604c0c5a (patch)
tree3ceb366c12f0bc229cfcd5fce6c2f409e29fe06b /lib/eval-source.nix
parentfc3f5d3d56a299b7b46c1a42d3fec57c536a5917 (diff)
move source config from module system to 1systems/*/source.nix
Diffstat (limited to 'lib/eval-source.nix')
-rw-r--r--lib/eval-source.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/eval-source.nix b/lib/eval-source.nix
new file mode 100644
index 00000000..de5f0b43
--- /dev/null
+++ b/lib/eval-source.nix
@@ -0,0 +1,17 @@
+with import <stockholm/lib>;
+let
+ eval = _file: source: evalModules {
+ modules = singleton {
+ inherit _file;
+ options.source = mkOption {
+ type = types.attrsOf types.source;
+ default = {};
+ };
+ config = {
+ inherit source;
+ };
+ };
+ };
+in
+ # This function's return value can be used as pkgs.populate input.
+ _file: source: (eval _file source).config.source