2017-07-06 21:47:47 +02:00
|
|
|
with import <stockholm/lib>;
|
|
|
|
let
|
|
|
|
eval = _file: source: evalModules {
|
|
|
|
modules = singleton {
|
|
|
|
inherit _file;
|
2017-07-12 17:53:41 +02:00
|
|
|
imports = map (source: { inherit source; }) (toList source);
|
2017-07-06 21:47:47 +02:00
|
|
|
options.source = mkOption {
|
|
|
|
type = types.attrsOf types.source;
|
|
|
|
default = {};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2017-07-22 23:34:47 +02:00
|
|
|
sanitize = x: getAttr (typeOf x) {
|
|
|
|
set = mapAttrs
|
|
|
|
(const sanitize)
|
|
|
|
(filterAttrs (name: value: name != "_module" && value != null) x);
|
|
|
|
string = x;
|
|
|
|
};
|
2017-07-06 21:47:47 +02:00
|
|
|
in
|
|
|
|
# This function's return value can be used as pkgs.populate input.
|
2017-07-22 23:34:47 +02:00
|
|
|
_file: source: sanitize (eval _file source).config.source
|