Flake for my NixOS devices
1{...}: {
2 lib,
3 config,
4 ...
5}: {
6 options.cow.htop.enable = lib.mkEnableOption "htop + customizations";
7
8 config = lib.mkIf config.cow.htop.enable {
9 # TODO: Actually use Nix for this
10 xdg.configFile."htop/htoprc".text = ''
11 htop_version=3.3.0
12 config_reader_min_version=3
13 fields=0 3 2 18 46 47 39 1
14 hide_kernel_threads=1
15 hide_userland_threads=0
16 hide_running_in_container=0
17 shadow_other_users=0
18 show_thread_names=1
19 show_program_path=0
20 highlight_base_name=1
21 highlight_deleted_exe=0
22 shadow_distribution_path_prefix=0
23 highlight_megabytes=1
24 highlight_threads=1
25 highlight_changes=0
26 highlight_changes_delay_secs=5
27 find_comm_in_cmdline=1
28 strip_exe_from_cmdline=1
29 show_merged_command=0
30 header_margin=1
31 screen_tabs=1
32 detailed_cpu_time=0
33 cpu_count_from_one=1
34 show_cpu_usage=1
35 show_cpu_frequency=0
36 show_cpu_temperature=1
37 degree_fahrenheit=0
38 update_process_names=0
39 account_guest_in_cpu_meter=1
40 color_scheme=0
41 enable_mouse=1
42 delay=15
43 hide_function_bar=0
44 header_layout=two_67_33
45 column_meters_0=System Hostname Date Clock Uptime Tasks CPU AllCPUs4 MemorySwap
46 column_meter_modes_0=2 2 2 2 2 2 2 1 1
47 column_meters_1=DiskIO DiskIO Blank NetworkIO NetworkIO
48 column_meter_modes_1=2 3 2 2 3
49 tree_view=0
50 sort_key=46
51 tree_sort_key=0
52 sort_direction=-1
53 tree_sort_direction=1
54 tree_view_always_by_pid=0
55 all_branches_collapsed=0
56 screen:Main=PID PPID STATE NICE PERCENT_CPU PERCENT_MEM M_RESIDENT Command
57 .sort_key=PERCENT_CPU
58 .tree_sort_key=PID
59 .tree_view_always_by_pid=0
60 .tree_view=0
61 .sort_direction=-1
62 .tree_sort_direction=1
63 .all_branches_collapsed=0
64 screen:Tree=PID PPID PGRP PROCESSOR TTY USER SESSION Command
65 .sort_key=PID
66 .tree_sort_key=PID
67 .tree_view_always_by_pid=0
68 .tree_view=1
69 .sort_direction=1
70 .tree_sort_direction=1
71 .all_branches_collapsed=0
72 screen:I/O=PID PPID IO_READ_RATE IO_WRITE_RATE Command
73 .sort_key=IO_RATE
74 .tree_sort_key=PID
75 .tree_view_always_by_pid=0
76 .tree_view=0
77 .sort_direction=-1
78 .tree_sort_direction=1
79 .all_branches_collapsed=0
80 '';
81 programs.htop = {
82 enable = true;
83 };
84 xdg.dataFile = lib.mkIf config.cow.gdi.enable {
85 "applications/htop.desktop".text = ''
86 [Desktop Entry]
87 Type=Application
88 Name=Htop
89 Exec=wezterm start --class="htop" htop
90 Icon=htop
91 '';
92 };
93 };
94}