From a0828c8916c8674816e25cf01fa4b07c05eec6e8 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 22 Jul 2017 23:34:47 +0200 Subject: lib.eval-source: sanitize source --- lib/eval-source.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/eval-source.nix b/lib/eval-source.nix index 468fc92d1..ff853185b 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 -- cgit v1.2.3