From 673e7b8245a67d5627ff41ab1c113c90b4c8c553 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sat, 29 Aug 2026 02:22:48 +0530 Subject: system: removed system-monitor, removed bottom, added btop --- assets/icons/bottom-system-monitor.svg | 127 ------------------------ modules/system/bottom/default.nix | 23 ----- modules/system/btop/default.nix | 23 +++++ modules/system/default.nix | 3 +- modules/system/system-monitor/assertions.nix | 19 ---- modules/system/system-monitor/default.nix | 41 -------- modules/system/system-monitor/system-monitor.sh | 26 ----- users/arpit.nix | 2 +- 8 files changed, 25 insertions(+), 239 deletions(-) delete mode 100644 assets/icons/bottom-system-monitor.svg delete mode 100644 modules/system/bottom/default.nix create mode 100644 modules/system/btop/default.nix delete mode 100644 modules/system/system-monitor/assertions.nix delete mode 100644 modules/system/system-monitor/default.nix delete mode 100644 modules/system/system-monitor/system-monitor.sh diff --git a/assets/icons/bottom-system-monitor.svg b/assets/icons/bottom-system-monitor.svg deleted file mode 100644 index f873bbd..0000000 --- a/assets/icons/bottom-system-monitor.svg +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/system/bottom/default.nix b/modules/system/bottom/default.nix deleted file mode 100644 index b037c56..0000000 --- a/modules/system/bottom/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -# Cross-platform graphical process and system monitor -{ - config, - lib, - ... -}: -{ - options.system.bottom = { - enable = lib.mkEnableOption "Enables bottom."; - package = lib.mkOption { - type = lib.types.package; - readOnly = true; - default = config.programs.bottom.package; - description = "The bottom package to use."; - }; - }; - - config = lib.mkIf config.system.bottom.enable { - programs.bottom = { - enable = true; - }; - }; -} diff --git a/modules/system/btop/default.nix b/modules/system/btop/default.nix new file mode 100644 index 0000000..1834aa2 --- /dev/null +++ b/modules/system/btop/default.nix @@ -0,0 +1,23 @@ +# Cross-platform graphical process and system monitor +{ + config, + lib, + ... +}: +{ + options.system.btop = { + enable = lib.mkEnableOption "Enables btop."; + package = lib.mkOption { + type = lib.types.package; + readOnly = true; + default = config.programs.btop.package; + description = "The btop package to use."; + }; + }; + + config = lib.mkIf config.system.btop.enable { + programs.btop = { + enable = true; + }; + }; +} diff --git a/modules/system/default.nix b/modules/system/default.nix index 9bd3a01..bf19c04 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -2,13 +2,12 @@ { ... }: { imports = [ - ./bottom ./brightnessctl + ./btop ./deep-clean ./htop ./nix-update ./nvtop - ./system-monitor ./systemctl-tui ]; } diff --git a/modules/system/system-monitor/assertions.nix b/modules/system/system-monitor/assertions.nix deleted file mode 100644 index 08b9f7c..0000000 --- a/modules/system/system-monitor/assertions.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, ... }: -[ - { - assertion = !config.system.system-monitor.enable || config.system.bottom.enable; - message = "system.system-monitor is enabled but requires `system.bottom.enable`."; - } - { - assertion = !config.system.system-monitor.enable || config.system.nvtop.enable; - message = "system.system-monitor is enabled but requires `system.nvtop.enable`."; - } - { - assertion = !config.system.system-monitor.enable || config.terminal.tmux.enable; - message = "system.system-monitor is enabled but requires `terminal.tmux.enable`."; - } - { - assertion = !config.system.system-monitor.enable || config.terminal.kitty.enable; - message = "system.system-monitor is enabled but requires `terminal.kitty.enable`."; - } -] diff --git a/modules/system/system-monitor/default.nix b/modules/system/system-monitor/default.nix deleted file mode 100644 index e103ed3..0000000 --- a/modules/system/system-monitor/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -# System monitor script using tmux to run bottom and nvtop side-by-side -{ - config, - lib, - pkgs, - ... -}: -let - inherit ((import ../../lib/script.nix { inherit lib pkgs; })) mkScriptModule; - script = mkScriptModule { - scope = [ "system" ]; - name = "system-monitor"; - path = ./system-monitor.sh; - description = "System monitor script using tmux to run bottom and nvtop side-by-side\nOpens a tmux session with:\n - Left pane: bottom (system/process monitor)\n - Right pane: nvtop (GPU monitor)"; - deps = [ - config.system.bottom.package - config.system.nvtop.package - config.terminal.tmux.package - config.terminal.kitty.package - pkgs.bash - ]; - desktop = { - enable = true; - displayName = "System Monitor"; - icon = "bottom-system-monitor"; - }; - inherit config; - }; -in -{ - options = script.options; - config = lib.mkMerge [ - script.config - { - assertions = import ./assertions.nix { inherit config lib; }; - home.file.".local/share/icons/hicolor/scalable/apps/bottom-system-monitor.svg" = { - source = ../../../assets/icons/bottom-system-monitor.svg; - }; - } - ]; -} diff --git a/modules/system/system-monitor/system-monitor.sh b/modules/system/system-monitor/system-monitor.sh deleted file mode 100644 index 7a9e7ea..0000000 --- a/modules/system/system-monitor/system-monitor.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -SESSION="system-monitor" - -kitty @ set-font-size -- -5 - -cleanup() { - kitty @ set-font-size -- +5 -} -trap cleanup EXIT INT TERM - -# Kill any existing session -tmux kill-session -t "$SESSION" 2>/dev/null - -# Start new tmux session with btm wrapped to kill session on exit -tmux new-session -d -s "$SESSION" -c "$HOME" "bash -c 'btm; tmux kill-session -t $SESSION'" - -# Split horizontally: right pane runs nvtop wrapped similarly -tmux split-window -h -t "$SESSION:0" -c "$HOME" "bash -c 'nvtop; tmux kill-session -t $SESSION'" - -tmux set -g status off -tmux set -g mouse on -tmux set -g focus-events on - -# Select main pane and attach -tmux select-pane -t "$SESSION:0.0" -tmux attach-session -t "$SESSION" diff --git a/users/arpit.nix b/users/arpit.nix index 0bf8e73..46b3702 100644 --- a/users/arpit.nix +++ b/users/arpit.nix @@ -68,7 +68,7 @@ security.ssh.enable = true; # System - system.bottom.enable = true; + system.btop.enable = true; system.brightnessctl.enable = true; system.htop.enable = true; system.nvtop.enable = true; -- cgit v1.2.3