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

om health: Add info in json output #404

Merged
merged 4 commits into from
Jan 31, 2025
Merged

om health: Add info in json output #404

merged 4 commits into from
Jan 31, 2025

Conversation

shivaraj-bh
Copy link
Member

@shivaraj-bh shivaraj-bh commented Jan 30, 2025

Example output:

{
  "checks": {
    "shell": {
      "title": "Shell dotfiles",
      "info": "Shell=Zsh; HOME=\"/Users/shivaraj\"; Managed: {\".zshenv\": \"/nix/store/csica6diirv3swl0gqhwvpkyh8r7fhfw-hm_.zshenv\", \".zshrc\": \"/nix/store/rxw82293y8b3nc65k2d49ji9i8kbc375-hm_.zshrc\"}; Unmanaged: {}",
      "result": "Green",
      "required": false
    },
    "flake-enabled": {
      "title": "Flakes Enabled",
      "info": "experimental-features = flakes fetch-tree nix-command",
      "result": "Green",
      "required": true
    },
    "supported-nix-versions": {
      "title": "Nix Version is supported",
      "info": "nix version = 2.24.10",
      "result": "Green",
      "required": true
    },
    "direnv-install-check": {
      "title": "Direnv installation",
      "info": "direnv location = Some(\"/Users/shivaraj/.nix-profile/bin/direnv\")",
      "result": "Green",
      "required": false
    },
    "rosetta": {
      "title": "Rosetta Not Active",
      "info": "apple emulation = false",
      "result": "Green",
      "required": true
    },
    "max-jobs": {
      "title": "Max Jobs",
      "info": "max-jobs = 8",
      "result": "Green",
      "required": true
    },
    "trusted-users": {
      "title": "Trusted Users",
      "info": "trusted-users = root shivaraj",
      "result": "Green",
      "required": true
    },
    "caches": {
      "title": "Nix Caches in use",
      "info": "substituters = https://cache.nixos.org/ https://euler.cachix.org/ https://newton.cachix.org/ https://om.cachix.org/",
      "result": "Green",
      "required": true
    }
  },
  "info": {
    "nix_installer": {
      "type": "DetSys",
      "version": {
        "major": 0,
        "minor": 16,
        "patch": 0
      }
    },
    "system": "aarch64-darwin",
    "os": "macOS",
    "total_memory": "17.2 GB",
    "total_disk_space": "493.9 GB"
  }
}

@srid
Copy link
Member

srid commented Jan 30, 2025

"nix-installer": "DetSys nix-installer (0.16.0)",

Is this structured enough for consuming in nixone and the like?

Instead if you had something like:

{
  "nix-installer": {
    "type": "detsys";
    "meta": { "version": 0.16.0 } }
  }
}

wouldn't it be easier to consume in nixone? Especially latter if for some reason we want to check the version as well.

@shivaraj-bh
Copy link
Member Author

"nix-installer": "DetSys nix-installer (0.16.0)",

Is this structured enough for consuming in nixone and the like?

Instead if you had something like:

{
  "nix-installer": {
    "type": "detsys";
    "meta": { "version": 0.16.0 } }
  }
}

wouldn't it be easier to consume in nixone? Especially latter if for some reason we want to check the version as well.

The new structure after 7c67f8a:

"info": {
    "nix_installer": {
      "type": "DetSys",
      "version": {
        "major": 0,
        "minor": 16,
        "patch": 0
      }
    },
    "system": "aarch64-darwin",
    "os": "macOS",
    "total_memory": "17.2 GB",
    "total_disk_space": "493.9 GB"
  }

@shivaraj-bh shivaraj-bh changed the title om health: sysinfo in json output om health: Add info in json output Jan 30, 2025
@srid srid merged commit e322518 into main Jan 31, 2025
3 checks passed
@srid srid deleted the sysinfo-json branch January 31, 2025 01:00
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.

2 participants