diff options
author | tv <tv@krebsco.de> | 2017-07-22 23:34:47 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2017-07-23 00:29:38 +0200 |
commit | 2c7538b70e0c4120264b53e76968df567beeeb87 (patch) | |
tree | 2951a78e33ef3f7632da884a5e1a20ecaae46946 | |
parent | 05beb825b7a7081ae108713ac1b4076df3f1375f (diff) |
lib.eval-source: sanitize source
-rw-r--r-- | lib/eval-source.nix | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/eval-source.nix b/lib/eval-source.nix index 468fc92..ff85318 100644 --- a/lib/eval-source.nix +++ b/lib/eval-source.nix @@ -10,6 +10,12 @@ let }; }; }; + sanitize = x: getAttr (typeOf x) { + set = mapAttrs + (const sanitize) + (filterAttrs (name: value: name != "_module" && value != null) x); + string = x; + }; in # This function's return value can be used as pkgs.populate input. - _file: source: (eval _file source).config.source + _file: source: sanitize (eval _file source).config.source |