about summary refs log tree commit diff
path: root/modules/common/htop.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-02-19 17:50:35 +0300
committerAzat Bahawi <azat@bahawi.net>2023-02-19 17:50:35 +0300
commit91fb4f28ef5d87e8bcf7749928d30ba4a9cbbd34 (patch)
treee07291fcb1cf62a561ffe58d1fd8e2968ff6fcb3 /modules/common/htop.nix
parent2023-02-15 (diff)
2023-02-19
Diffstat (limited to 'modules/common/htop.nix')
-rw-r--r--modules/common/htop.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/modules/common/htop.nix b/modules/common/htop.nix
new file mode 100644
index 0000000..bf3f1e4
--- /dev/null
+++ b/modules/common/htop.nix
@@ -0,0 +1,57 @@
+{
+  config,
+  lib,
+  ...
+}:
+with lib; let
+  cfg = config.nixfiles.modules.htop;
+in {
+  options.nixfiles.modules.htop.enable =
+    mkEnableOption "htop";
+
+  config = mkIf cfg.enable {
+    hm.programs.htop = {
+      enable = true;
+
+      settings = with config.hm.lib.htop; {
+        fields = with fields; [
+          PID
+          USER
+          PRIORITY
+          NICE
+          M_SIZE
+          M_RESIDENT
+          M_SHARE
+          STATE
+          PERCENT_CPU
+          PERCENT_MEM
+          TIME
+          COMM
+        ];
+        account_guest_in_cpu_meter = 1;
+        detailed_cpu_time = 0;
+        enable_mouse = 0;
+        find_comm_in_cmdline = 1;
+        header_margin = 1;
+        hide_function_bar = 1;
+        hide_kernel_threads = 1;
+        hide_userland_threads = 1;
+        highlight_base_name = 1;
+        highlight_changes = 0;
+        highlight_changes_delay_secs = 1;
+        highlight_deleted_exe = 1;
+        highlight_megabytes = 1;
+        highlight_threads = 1;
+        shadow_other_users = 1;
+        show_cpu_frequency = 1;
+        show_cpu_usage = 1;
+        show_program_path = 0;
+        show_thread_names = 0;
+        strip_exe_from_cmdline = 1;
+        tree_view = 1;
+        tree_view_always_by_pid = 1;
+        update_process_names = 1;
+      };
+    };
+  };
+}

Consider giving Nix/NixOS a try! <3