summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2017-07-22 23:34:47 +0200
committerlassulus <lassulus@lassul.us>2017-07-23 21:19:14 +0200
commita0828c8916c8674816e25cf01fa4b07c05eec6e8 (patch)
tree29ebe38f8bb1ac64166fbce67d14a6109ea1c6a2
parentc6998911fad98bfefe3f7a94a7b520fd88e2f9a0 (diff)
lib.eval-source: sanitize source
-rw-r--r--lib/eval-source.nix8
1 files changed, 7 insertions, 1 deletions
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