#cpu #gathering #temperature #distro #name #info #system-information

nixinfo

A lib crate for gathering system info such as cpu, distro, environment, kernel, etc in Rust

24 releases

0.3.3 Mar 19, 2021
0.3.2 Dec 11, 2020
0.3.0 Sep 3, 2020
0.2.9 Sep 3, 2020
0.1.9 Aug 16, 2020

#478 in Unix APIs

Download history 10/week @ 2024-07-20 20/week @ 2024-07-27 12/week @ 2024-08-03 16/week @ 2024-08-10 10/week @ 2024-08-17 14/week @ 2024-08-24 23/week @ 2024-08-31 15/week @ 2024-09-07 19/week @ 2024-09-14 51/week @ 2024-09-21 26/week @ 2024-09-28 5/week @ 2024-10-05 11/week @ 2024-10-12 13/week @ 2024-10-19 12/week @ 2024-10-26 18/week @ 2024-11-02

54 downloads per month
Used in 5 crates

Unlicense

20KB
417 lines

nixinfo

A lib crate for gathering system info such as cpu, distro, environment, kernel, etc in Rust.

To use: nixinfo = "0.2.8" in your Cargo.toml.

Currently supported

  • CPU model and temperature (Celsius)
    • nixinfo::cpu() -> Result<String>
    • nixinfo::temp() -> Result<String>
  • Device name
    • nixinfo::device() -> Result<String>
  • Distro name
    • nixinfo::distro() -> Result<String>
  • Environment (e.g. DE or WM)
    • nixinfo::environment() -> Result<String>
  • env variables
    • nixinfo::env("VARIABLE") -> Option<String>
  • GPU info (requires lspci and grep to be installed for now until I find a pure rust solution)
    • nixinfo::gpu() -> Result<String>
  • Hostname
    • nixinfo::hostname() -> Result<String>
  • Kernel
    • nixinfo::kernel() -> Result<String>
  • Total memory in MBs
    • nixinfo::memory() -> Result<String>
  • Music info (only mpd is supported, requires music feature to be enabled)
    • nixinfo::music() -> String
  • Package counts (managers supported are apk, apt, dnf, dpkg, eopkg, pacman, pip, portage, rpm, and xbps)
    • nixinfo::packages("manager") -> Result<String>
  • Terminal being used (unless tmux is used, in which case N/A will be outputted because reasons)
    • nixnfo::terminal() -> Result<String>
  • Uptime of device
    • nixinfo::uptime() -> Result<String>

TODO

  • Obtain used memory in addition to total memory
  • Support *BSD

Dependencies

~43–510KB