A system monitor for the terminal, written in pure Nix. A btop clone that demonstrates advanced Nix programming techniques.
- CPU usage with per-core breakdown and sparklines
- Memory and swap monitoring with visual progress bars
- Disk usage for mounted filesystems with usage percentages
- Network throughput with historical graphs and interface statistics
- Process list sorted by resource usage with filtering and selection
- Temperature sensors
- Battery status (macOS)
- Multiple color themes (default, nord, gruvbox, dracula, monokai, solarized)
- Auto-resize to fill terminal window
- Mouse support for scrolling and interaction
- Keyboard shortcuts for navigation and control
- Nix with flakes enabled
- macOS or Linux
Install globally so you can run nixmon from anywhere, just like btop:
# From the nixmon directory
./install.sh
# Or from anywhere, pointing to the flake
./install.sh /path/to/nixmon
# Or install directly from GitHub (once published)
nix profile install github:0xatrilla/nixmon#nixmonAfter installation, simply run:
nixmonThe nixmon command will be available in your PATH, just like any other system command.
Run directly with Nix (no installation needed):
# From GitHub (once published)
nix run github:0xatrilla/nixmon
# Or from local directory
nix run .nix profile upgrade nixmonnix profile remove nixmonNIXMON_THEME: Color theme (default, nord, gruvbox, dracula, monokai, solarized)NIXMON_REFRESH: Refresh interval in seconds (default: 2)
Example:
NIXMON_THEME=nord nixmonCreate ~/.config/nixmon/nixmon.conf (or $XDG_CONFIG_HOME/nixmon/nixmon.conf) with btop-style keys:
color_theme = "nord"
update_ms = 1500
proc_sorting = "cpu"
proc_reversed = false
net_iface = "auto"
disk_filter = ""
disk_filter accepts a regex; prefix with ! to exclude matches.
q,Esc- Quit+,=- Increase refresh rate-,_- Decrease refresh ratet- Cycle themese- Edit configs- Cycle sort key (CPU/MEM/PID/NAME)r- Toggle sort orderf- Clear process filter↑/↓- Move process selectionEnter,i- Toggle process detailsk- Kill selected processh,?- Toggle help overlay
- Scroll wheel - Scroll process list
- Click - Select process
After installation, several commands are available:
nixmon- Run the system monitornixmon-themes- Preview available themesnixmon-export-json- Export current metrics to JSONnixmon-export-csv- Export current metrics to CSV
nixmon is implemented entirely in the Nix language, demonstrating advanced Nix programming techniques including:
- Pure functional data processing
- ANSI terminal rendering with Unicode box-drawing characters
- System metrics collection via
/proc(Linux) and system commands (macOS) - State management for delta calculations (CPU usage, network speed, etc.)
- Real-time terminal UI with flicker reduction
- Signal handling for terminal resize events
- Mouse event parsing and handling
- Modular architecture with separate modules for UI, metrics, and platform-specific code
MIT