Merge pull request #293542 from lf-/jade/update-nixos-option

nixos-option: update to nix 2.18
This commit is contained in:
Martin Weinelt 2024-03-05 18:27:04 +01:00 committed by GitHub
commit 0cfd293af3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 9 deletions

View file

@ -368,20 +368,20 @@ std::string describeError(const Error & e) { return "«error: " + e.msg() + "»"
void describeDerivation(Context & ctx, Out & out, Value v) void describeDerivation(Context & ctx, Out & out, Value v)
{ {
// Copy-pasted from nix/src/nix/repl.cc :( // Copy-pasted from nix/src/nix/repl.cc :(
out << "«derivation ";
Bindings::iterator i = v.attrs->find(ctx.state.sDrvPath); Bindings::iterator i = v.attrs->find(ctx.state.sDrvPath);
PathSet pathset; nix::NixStringContext strContext;
try { if (i != v.attrs->end())
Path drvPath = i != v.attrs->end() ? ctx.state.coerceToPath(i->pos, *i->value, pathset, "while evaluating the drvPath of a derivation") : "???"; out << ctx.state.store->printStorePath(ctx.state.coerceToStorePath(i->pos, *i->value, strContext, "while evaluating the drvPath of a derivation"));
out << "«derivation " << drvPath << "»"; else
} catch (Error & e) { out << "???";
out << describeError(e); out << "»";
}
} }
Value parseAndEval(EvalState & state, const std::string & expression, const std::string & path) Value parseAndEval(EvalState & state, const std::string & expression, const std::string & path)
{ {
Value v{}; Value v{};
state.eval(state.parseExprFromString(expression, absPath(path)), v); state.eval(state.parseExprFromString(expression, nix::SourcePath(nix::CanonPath::fromCwd(path))), v);
return v; return v;
} }

View file

@ -40368,7 +40368,7 @@ with pkgs;
nix-melt = callPackage ../tools/nix/nix-melt { }; nix-melt = callPackage ../tools/nix/nix-melt { };
nixos-option = callPackage ../tools/nix/nixos-option { nixos-option = callPackage ../tools/nix/nixos-option {
nix = nixVersions.nix_2_15; nix = nixVersions.nix_2_18;
}; };
nix-pin = callPackage ../tools/package-management/nix-pin { }; nix-pin = callPackage ../tools/package-management/nix-pin { };