lib/generators.toPretty: don't evaluate derivations
With the goal of making `toPretty` suitable for rendering option values, render derivations as `<derivation foo-1.0>` instead of `<derivation /nix/store/…-foo-1.0.drv>`. This is to avoid causing sudden evaluation errors for out-of-tree projects that have options with `default = pkgs.someUnfreePackage;` and no `defaultText`.
This commit is contained in:
parent
0ff3b35356
commit
0fa7b1b004
2 changed files with 2 additions and 2 deletions
|
@ -330,7 +330,7 @@ rec {
|
|||
then v.__pretty v.val
|
||||
else if v == {} then "{ }"
|
||||
else if v ? type && v.type == "derivation" then
|
||||
"<derivation ${v.drvPath or "???"}>"
|
||||
"<derivation ${v.name or "???"}>"
|
||||
else "{" + introSpace
|
||||
+ libStr.concatStringsSep introSpace (libAttr.mapAttrsToList
|
||||
(name: value:
|
||||
|
|
|
@ -754,7 +754,7 @@ runTests {
|
|||
emptylist = "[ ]";
|
||||
attrs = "{ foo = null; \"foo bar\" = \"baz\"; }";
|
||||
emptyattrs = "{ }";
|
||||
drv = "<derivation ${deriv.drvPath}>";
|
||||
drv = "<derivation ${deriv.name}>";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue