1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00

nix flake show: name attribute that must be a derivation

I would run `nix flake show` on a flake than hit:

===
        ├───ihaskell: package 'ihaskell-wrapper'
        ├───ihaskell-96: package 'ihaskell-wrapper'
        ├───ihaskell-96-dev: package 'ghc-shell-for-ihaskell-0.10.4.0'
error: expected a derivation
===
and it is not obvious what package is the culprit here since nix stops
rightaway.
This commit is contained in:
Matthieu Coudron 2023-08-27 00:29:05 +02:00 committed by Matthieu C.
parent 89ba6dff66
commit 52b7357a1b

View file

@ -1332,8 +1332,10 @@ struct CmdFlakeShow : FlakeCommand, MixJSON
try {
if (visitor.isDerivation())
showDerivation();
else
throw Error("expected a derivation");
else {
auto name = visitor.getAttrPathStr(state->sName);
logger->warn(fmt("%s must be a derivation", name));
}
} catch (IFDError & e) {
if (!json) {
logger->cout(fmt("%s " ANSI_WARNING "omitted due to use of import from derivation" ANSI_NORMAL, headerPrefix));