Skip to content

Commit

Permalink
om health: Make RAM/disk space part of info (not checks) (#323)
Browse files Browse the repository at this point in the history
These are not directly relevant to Nix, so let's just display their
information on the banner.

<img width="375" alt="image"
src="https://github.com/user-attachments/assets/60b8759b-4eb5-4095-8d0b-fdb9e45c35b5">
  • Loading branch information
srid authored Oct 16, 2024
1 parent 1a67e61 commit 6d32e20
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 90 deletions.
1 change: 0 additions & 1 deletion crates/nix_health/src/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ pub mod flake_enabled;
pub mod max_jobs;
pub mod min_nix_version;
pub mod rosetta;
pub mod system;
pub mod trusted_users;
81 changes: 0 additions & 81 deletions crates/nix_health/src/check/system.rs

This file was deleted.

4 changes: 2 additions & 2 deletions crates/nix_health/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ pub struct NixHealth {
pub flake_enabled: FlakeEnabled,
pub max_jobs: MaxJobs,
pub rosetta: Rosetta,
pub system: check::system::System,
pub trusted_users: TrustedUsers,
pub caches: Caches,
pub direnv: Direnv,
Expand All @@ -50,7 +49,6 @@ impl<'a> IntoIterator for &'a NixHealth {
&self.flake_enabled,
&self.max_jobs,
&self.rosetta,
&self.system,
&self.trusted_users,
&self.caches,
&self.direnv,
Expand Down Expand Up @@ -146,6 +144,8 @@ pub async fn run_checks_with(flake_url: Option<FlakeUrl>) -> anyhow::Result<Vec<
if nix_info.nix_env.os != OS::NixOS {
tracing::info!(" - Nix installer: {}", nix_info.nix_env.installer);
}
tracing::info!(" - RAM: {:?}", nix_info.nix_env.total_memory);
tracing::info!(" - Disk Space: {:?}", nix_info.nix_env.total_disk_space);

let checks = health.run_checks(nix_info, flake_url.clone());
Ok(checks)
Expand Down
2 changes: 1 addition & 1 deletion crates/nix_rs/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl Display for OS {
arch: _,
} => {
if *nix_darwin {
write!(f, "nix-darwin")
write!(f, "macOS (nix-darwin)")
} else {
write!(f, "macOS")
}
Expand Down
1 change: 1 addition & 0 deletions doc/src/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- `om health`
- Display Nix installer used (supports DetSys installer)
- Display information in Markdown
- Remove RAM/disk space checks, moving them to "information" section
- `om ci`
- Support for remote builds over SSH (via `--on` option)
- Support for CI steps
Expand Down
5 changes: 0 additions & 5 deletions nix/modules/om.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@
nix-version.min-required = "2.16.0";
caches.required = [ "https://om.cachix.org" ];
direnv.required = true;
system = {
# required = true;
min_ram = "16G";
# min_disk_space = "2T";
};
};
hack.default = {
# TODO: This is not implemented yet.
Expand Down

0 comments on commit 6d32e20

Please sign in to comment.