summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2020-09-02 16:10:17 +0200
committerSilvan Mosberger <contact@infinisil.com>2020-11-30 23:51:23 +0100
commit1e6a84b7af71f579f2467619f504d1cfe43bb3e9 (patch)
tree64034cb8896b22a91fd46e78a1ff4281475aa184 /lib
parent20131348db3b51f7fe41f2d4aa3cd8875a6b48f2 (diff)
nixos/modules: Allow options to be coerced to a string for convenience
Diffstat (limited to 'lib')
-rw-r--r--lib/modules.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index 1902db5c6167..9ff8f4701bb3 100644
--- a/lib/modules.nix
+++ b/lib/modules.nix
@@ -665,6 +665,8 @@ rec {
definitions = map (def: def.value) res.defsFinal;
files = map (def: def.file) res.defsFinal;
inherit (res) isDefined;
+ # This allows options to be correctly displayed using `${options.path.to.it}`
+ __toString = _: showOption loc;
};
# Merge definitions of a value of a given type.