o
odinpkg.dev
packages / tool / nixfetch

nixfetch

v0.4.10tool

A fast, minimal system information fetch tool for NixOS

MIT · updated 4 months ago

nixfetch

A fast, minimal system information fetch tool for Linux, written in Odin. Displays system info alongside a colored NixOS logo.

Preview

Colored NixOS logo

Black & White NixOS logo

Custom image preview 1

Custom image preview 2

Custom image preview 3

Custom Image Support

On terminals that support the Kitty graphics protocol (e.g. Ghostty, Kitty), you can display a custom PNG image instead of the ANSI logo by setting the NIXFETCH_IMAGE environment variable:

NIXFETCH_IMAGE=/path/to/image.png nixfetch

If the terminal does not support the Kitty graphics protocol, or the variable is unset, nixfetch falls back to the default colored ANSI logo.

Information Displayed

Field Source
User $USER + uname syscall
OS /etc/os-release PRETTY_NAME
Host /sys/devices/virtual/dmi/id/
Kernel uname syscall
Shell $SHELL
Desktop $XDG_CURRENT_DESKTOP / $XDG_SESSION_TYPE
Memory /proc/meminfo
Swap /proc/meminfo
Terminal $TERM_PROGRAM
Uptime sysinfo syscall
Colors ANSI color palette

Building

Prerequisites

If you're on NixOS or have Nix installed, a dev shell is provided:

nix develop

Build & Run

# default (debug) build
just build
just run

# optimized builds
just build-speed      # speed optimization
just build-size       # size optimization
just build-aggressive # aggressive optimization
just build-minimal    # minimal optimization

# build and run in one step
just run-speed

Binaries are output to target/<variant>/nixfetch.

Project Structure

src/
├── main.odin     # entry point, collects system info
├── lib.odin      # system info gathering functions
└── format.odin   # NixOS logo definitions
flake.nix         # Nix dev environment
justfile          # build recipes

License

MIT