Skip to content

Commit

Permalink
support old Nix versions
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Mar 21, 2024
1 parent 89fa20a commit 868cbd9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions devenv/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,10 @@ impl App {
}

if !caches.caches.pull.is_empty() {
// parse trusted from store and assert it's 1
if serde_json::from_slice::<StorePing>(&store.stdout)
let trusted = serde_json::from_slice::<StorePing>(&store.stdout)
.expect("Failed to parse JSON")
.trusted
!= 1
{
.trusted;
if trusted == Some(0) {
bail!(indoc::formatdoc!(
"You're not a trusted user of the Nix store. You have the following options:
Expand Down Expand Up @@ -360,5 +358,5 @@ struct CachixResponse {

#[derive(Deserialize, Clone)]
struct StorePing {
trusted: u8,
trusted: Option<u8>,
}

0 comments on commit 868cbd9

Please sign in to comment.