#cpu #gathering #temperature #info #distro #lib #environment

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

#384 in Operating systems

Download history 25/week @ 2024-03-11 57/week @ 2024-03-18 79/week @ 2024-03-25 75/week @ 2024-04-01 14/week @ 2024-04-08 23/week @ 2024-04-15 24/week @ 2024-04-22 20/week @ 2024-04-29 17/week @ 2024-05-06 17/week @ 2024-05-13 29/week @ 2024-05-20 21/week @ 2024-05-27 20/week @ 2024-06-03 21/week @ 2024-06-10 24/week @ 2024-06-17 22/week @ 2024-06-24

90 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