#cpu #temperature #info #distro #lib #environment #kernel

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

#341 in Operating systems

Download history 6/week @ 2023-12-17 2/week @ 2023-12-24 8/week @ 2024-01-07 5/week @ 2024-01-14 3/week @ 2024-02-04 5/week @ 2024-02-11 13/week @ 2024-02-18 34/week @ 2024-02-25 27/week @ 2024-03-03 27/week @ 2024-03-10 33/week @ 2024-03-17 105/week @ 2024-03-24

195 downloads per month
Used in 6 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–500KB