mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 15:26:17 +02:00
Improve the config check
output for stores that don't know about trust
Make it proper english
This commit is contained in:
parent
dea23c3c9b
commit
bd8c276ddb
2 changed files with 9 additions and 4 deletions
|
@ -145,9 +145,14 @@ struct CmdConfigCheck : StoreCommand
|
||||||
|
|
||||||
void checkTrustedUser(ref<Store> store)
|
void checkTrustedUser(ref<Store> store)
|
||||||
{
|
{
|
||||||
auto trustedMay = store->isTrustedClient();
|
if (auto trustedMay = store->isTrustedClient()) {
|
||||||
std::string_view trustedness = trustedMay ? (*trustedMay ? "trusted" : "not trusted") : "unknown trust";
|
std::string_view trusted = trustedMay.value()
|
||||||
checkInfo(fmt("You are %s by store uri: %s", trustedness, store->getUri()));
|
? "trusted"
|
||||||
|
: "not trusted";
|
||||||
|
checkInfo(fmt("You are %s by store uri: %s", trusted, store->getUri()));
|
||||||
|
} else {
|
||||||
|
checkInfo(fmt("Store uri: %s doesn't have a notion of trusted user", store->getUri()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -6,4 +6,4 @@ store_uri="ssh://localhost?remote-store=$TEST_ROOT/other-store"
|
||||||
nix --store "$store_uri" store info --json | jq -e 'has("trusted") | not'
|
nix --store "$store_uri" store info --json | jq -e 'has("trusted") | not'
|
||||||
|
|
||||||
# Suppress grumpiness about multiple nixes on PATH
|
# Suppress grumpiness about multiple nixes on PATH
|
||||||
(nix --store "$store_uri" doctor || true) 2>&1 | grep 'You are unknown trust'
|
(nix --store "$store_uri" doctor || true) 2>&1 | grep "doesn't have a notion of trusted user"
|
||||||
|
|
Loading…
Reference in a new issue