Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix_health: trusted_users check #62

Merged
merged 31 commits into from
Sep 13, 2023
Merged

nix_health: trusted_users check #62

merged 31 commits into from
Sep 13, 2023

Conversation

shivaraj-bh
Copy link
Member

@shivaraj-bh shivaraj-bh commented Sep 12, 2023

Resolves #37

TODO:

  • Change suggestion based on os from SysInfo

Copy link
Member

@srid srid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the system_rs crate going to be useful in general sense? Given that it contains only information needed for nix_health, I'd think not. In that case, SysInfo should be part of nix_rs itself (presuming it provides information about the environment in which Nix is installed).

(Bear in mind that any local crate that nix_health depends will have to be published to crates.io, since we publish nix_health itself: https://crates.io/crates/nix_health)


[dependencies]
cfg-if.workspace = true
os_info = "3.7.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this crate be used for #58 as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will verify if that's possible.

@shivaraj-bh
Copy link
Member Author

shivaraj-bh commented Sep 13, 2023

Is the system_rs crate going to be useful in general sense?

I thought it could add on top of whatever os_info already provides and hence I was considering a separate crate. Maybe I should just stick to moving it to nix_rs for now and when we have enough information about the system and if the community needs such a crate we can separate it out.

@shivaraj-bh
Copy link
Member Author

Whether I am in rosetta or not, I get the following output from the os_info crate:

OS information: Mac OS 13.5.0 [64-bit]
Type: Mac OS
Version: 13.5.0
Edition: None
Codename: None
Bitness: 64-bit
Architecture: Some("arm64")

@shivaraj-bh shivaraj-bh marked this pull request as ready for review September 13, 2023 12:15
@shivaraj-bh
Copy link
Member Author

@srid I have added the condition to check whether the mac is configured using nix-darwin. I don't have a mac that uses it atm, it would be great if you could confirm that it works fine.

@srid
Copy link
Member

srid commented Sep 13, 2023

@srid I have added the condition to check whether the mac is configured using nix-darwin. I don't have a mac that uses it atm, it would be great if you could confirm that it works fine.

Alright, I'll take over from here.

@srid srid merged commit 817ba85 into main Sep 13, 2023
24 checks passed
@srid srid deleted the trusted-users branch September 13, 2023 19:04
@shivaraj-bh
Copy link
Member Author

@srid Went through the refactored code, was very helpful. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nix_health: check $USER is in trusted-users
2 participants