summaryrefslogtreecommitdiffstats
path: root/common/commandline
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2021-06-02 15:28:48 +0200
committerMinijackson <minijackson@riseup.net>2021-06-02 15:28:48 +0200
commit70cc223444059ea2885275dac9ef55f970b92281 (patch)
tree84fbba6a6092d3b7da1d91ab66c2375e1034ece5 /common/commandline
parentaab7b75826a1fafa3d2e3547c9c43d1745d73de9 (diff)
downloadnixos-config-reborn-70cc223444059ea2885275dac9ef55f970b92281.tar.gz
nixos-config-reborn-70cc223444059ea2885275dac9ef55f970b92281.zip
treewide: NixOS 20.09 -> NixOS 21.05
Diffstat (limited to 'common/commandline')
-rw-r--r--common/commandline/htop.nix127
1 files changed, 92 insertions, 35 deletions
diff --git a/common/commandline/htop.nix b/common/commandline/htop.nix
index 95763a0..dd04405 100644
--- a/common/commandline/htop.nix
+++ b/common/commandline/htop.nix
@@ -3,44 +3,101 @@ inputs:
3{ config, ... }: 3{ config, ... }:
4 4
5{ 5{
6 home-manager.users.minijackson = { ... }: 6 home-manager.users.minijackson = { config, ... }:
7 { 7 {
8 programs.htop = { 8 programs.htop = {
9 enable = true; 9 enable = true;
10 10
11 fields = [ 11 settings = {
12 "PID" "USER" 12 fields = with config.lib.htop.fields; [
13 "PRIORITY" "NICE" 13 PID
14 "STATE" 14 USER
15 "IO_PRIORITY" "IO_READ_RATE" "IO_WRITE_RATE" 15 PRIORITY
16 "PERCENT_CPU" "PERCENT_MEM" 16 NICE
17 "TIME" 17 STATE
18 "COMM" 18 IO_PRIORITY
19 ]; 19 IO_READ_RATE
20 20 IO_WRITE_RATE
21 hideThreads = true; 21 PERCENT_CPU
22 hideUserlandThreads = true; 22 PERCENT_MEM
23 showThreadNames = true; 23 TIME
24 shadowOtherUsers = true; 24 COMM
25 25 ];
26 highlightBaseName = true; 26
27 27 hide_threads = true;
28 # On NixOS? NO. 28 hide_kernel_threads = true;
29 showProgramPath = false; 29 hide_userland_threads = true;
30 30 show_thread_names = true;
31 treeView = true; 31 shadow_other_users = true;
32 32
33 meters = { 33 highlight_base_name = true;
34 left = [ "LeftCPUs2" "Memory" "Swap" "Blank" { kind = "Battery"; mode = 1; } ]; 34
35 right = [ "RightCPUs2" "Blank" "Tasks" "LoadAverage" "Uptime" ]; 35 # On NixOS? NO.
36 show_program_path = false;
37
38 tree_view = true;
39
40 left_meters = [
41 "LeftCPUs"
42 "Memory"
43 "Swap"
44 "Zram"
45 "Blank"
46 "Battery"
47 ];
48 left_meter_modes = with config.lib.htop.modes; [
49 Bar
50 Bar
51 Bar
52 Bar
53 Text
54 Bar
55 ];
56
57 right_meters = [
58 "RightCPUs"
59 "Blank"
60 "Tasks"
61 "LoadAverage"
62 "Uptime"
63 "Systemd"
64 ];
65 right_meter_modes = with config.lib.htop.modes; [
66 Bar
67 Text
68 Text
69 Text
70 Text
71 Text
72 ];
73 # TODO: this doesn't keep the order:
74 # https://github.com/nix-community/home-manager/issues/2060
75 /*
76 } // (with config.lib.htop; leftMeters {
77 LeftCPUs2 = modes.Bar;
78 Memory = modes.Bar;
79 Swap = modes.Bar;
80 Blank = modes.Text;
81 Battery = modes.Bar;
82 }) // (with config.lib.htop; rightMeters {
83 RightCPUs2 = modes.Bar;
84 Blank = modes.Text;
85 Tasks = modes.Text;
86 LoadAverage = modes.Text;
87 Uptime = modes.Text;
88 });
89 */
90 };
36 }; 91 };
37 }; 92 };
38 };
39 93
40 home-manager.users.root = { ... }: 94 home-manager.users.root = { ... }:
41 { 95 {
42 programs.htop = config.home-manager.users.minijackson.programs.htop // { 96 programs.htop = {
43 shadowOtherUsers = false; 97 enable = true;
98 settings = config.home-manager.users.minijackson.programs.htop.settings // {
99 shadowOtherUsers = false;
100 };
101 };
44 }; 102 };
45 };
46} 103}