diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-11-25 11:04:02 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-11-25 11:04:02 +0100 |
commit | f7171dca499b1508eecf4aa013f8084103f0dfc5 (patch) | |
tree | d42a5e3c9407dbe3adb41ceb0f6cf171e45963b3 | |
parent | 5a0d733319a259b2ce833cc995cb75be426f8f8d (diff) | |
download | nixos-f7171dca499b1508eecf4aa013f8084103f0dfc5.tar nixos-f7171dca499b1508eecf4aa013f8084103f0dfc5.tar.gz nixos-f7171dca499b1508eecf4aa013f8084103f0dfc5.tar.bz2 nixos-f7171dca499b1508eecf4aa013f8084103f0dfc5.tar.xz nixos-f7171dca499b1508eecf4aa013f8084103f0dfc5.zip |
...
-rw-r--r-- | user-profiles/utils.nix | 55 |
1 files changed, 49 insertions, 6 deletions
diff --git a/user-profiles/utils.nix b/user-profiles/utils.nix index 1db95688..c04e3a03 100644 --- a/user-profiles/utils.nix +++ b/user-profiles/utils.nix | |||
@@ -1,14 +1,57 @@ | |||
1 | { userName, pkgs, ... }: | 1 | { userName, lib, pkgs, config, ... }: |
2 | { | 2 | let |
3 | cfg = config.home-manager.users.${userName}; | ||
4 | |||
5 | wrappedLess = pkgs.less.overrideAttrs (oldAttrs: { | ||
6 | pname = "${oldAttrs.pname or "less"}-wrapper"; | ||
7 | |||
8 | nativeBuildInputs = (oldAttrs.nativeBuildInputs or []) ++ (with pkgs; [makeWrapper]); | ||
9 | |||
10 | postInstall = '' | ||
11 | ${oldAttrs.postInstall or ""} | ||
12 | |||
13 | wrapProgram $out/bin/less \ | ||
14 | --prefix PATH : ${lib.makeBinPath (with pkgs; [binutils])} | ||
15 | ''; | ||
16 | }); | ||
17 | in { | ||
3 | home-manager.users.${userName} = { | 18 | home-manager.users.${userName} = { |
4 | programs = { | 19 | programs = { |
5 | htop = { | 20 | htop = { |
6 | enable = true; | 21 | enable = true; |
7 | settings = { | 22 | settings = { |
8 | delay = 5; | 23 | delay = 5; |
9 | highlightBaseName = true; | 24 | unicode = true; |
10 | treeView = true; | 25 | hide_kernel_threads = true; |
11 | }; | 26 | hide_userland_threads = false; |
27 | shadow_other_users = true; | ||
28 | highlight_base_name = true; | ||
29 | highlight_deleted_exe = true; | ||
30 | highlight_megabytes = true; | ||
31 | highlight_threads = true; | ||
32 | find_comm_in_cmdline = true; | ||
33 | strip_exe_from_cmdline = true; | ||
34 | show_cpu_usage = true; | ||
35 | show_cpu_frequency = true; | ||
36 | show_cpu_temperature = true; | ||
37 | tree_view = true; | ||
38 | sort_key = cfg.lib.htop.fields.PERCENT_CPU; | ||
39 | tree_sort_key = cfg.lib.htop.fields.PERCENT_CPU; | ||
40 | } // (with cfg.lib.htop; leftMeters [ | ||
41 | (bar "LeftCPUs") | ||
42 | (bar "Memory") | ||
43 | (bar "Zram") | ||
44 | (bar "PressureStallCPUSome") | ||
45 | (bar "PressureStallIOSome") | ||
46 | (bar "PressureStallMemorySome") | ||
47 | ]) // (with cfg.lib.htop; rightMeters [ | ||
48 | (bar "RightCPUs") | ||
49 | (bar "Swap") | ||
50 | (bar "DiskIO") | ||
51 | (text "Tasks") | ||
52 | (text "Uptime") | ||
53 | (text "Systemd") | ||
54 | ]); | ||
12 | }; | 55 | }; |
13 | 56 | ||
14 | jq.enable = true; | 57 | jq.enable = true; |
@@ -24,7 +67,7 @@ | |||
24 | mosh tree vnstat file pv bc zip nmap aspell | 67 | mosh tree vnstat file pv bc zip nmap aspell |
25 | aspellDicts.de aspellDicts.en borgbackup man-pages rsync socat | 68 | aspellDicts.de aspellDicts.en borgbackup man-pages rsync socat |
26 | inetutils yq cached-nix-shell persistent-nix-shell rage | 69 | inetutils yq cached-nix-shell persistent-nix-shell rage |
27 | smartmontools hdparm nix-output-monitor | 70 | smartmontools hdparm nix-output-monitor wrappedLess |
28 | ]; | 71 | ]; |
29 | }; | 72 | }; |
30 | } | 73 | } |