From f7171dca499b1508eecf4aa013f8084103f0dfc5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 25 Nov 2022 11:04:02 +0100 Subject: ... --- user-profiles/utils.nix | 55 +++++++++++++++++++++++++++++++++++++++++++------ 1 file 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 @@ -{ userName, pkgs, ... }: -{ +{ userName, lib, pkgs, config, ... }: +let + cfg = config.home-manager.users.${userName}; + + wrappedLess = pkgs.less.overrideAttrs (oldAttrs: { + pname = "${oldAttrs.pname or "less"}-wrapper"; + + nativeBuildInputs = (oldAttrs.nativeBuildInputs or []) ++ (with pkgs; [makeWrapper]); + + postInstall = '' + ${oldAttrs.postInstall or ""} + + wrapProgram $out/bin/less \ + --prefix PATH : ${lib.makeBinPath (with pkgs; [binutils])} + ''; + }); +in { home-manager.users.${userName} = { programs = { htop = { enable = true; settings = { delay = 5; - highlightBaseName = true; - treeView = true; - }; + unicode = true; + hide_kernel_threads = true; + hide_userland_threads = false; + shadow_other_users = true; + highlight_base_name = true; + highlight_deleted_exe = true; + highlight_megabytes = true; + highlight_threads = true; + find_comm_in_cmdline = true; + strip_exe_from_cmdline = true; + show_cpu_usage = true; + show_cpu_frequency = true; + show_cpu_temperature = true; + tree_view = true; + sort_key = cfg.lib.htop.fields.PERCENT_CPU; + tree_sort_key = cfg.lib.htop.fields.PERCENT_CPU; + } // (with cfg.lib.htop; leftMeters [ + (bar "LeftCPUs") + (bar "Memory") + (bar "Zram") + (bar "PressureStallCPUSome") + (bar "PressureStallIOSome") + (bar "PressureStallMemorySome") + ]) // (with cfg.lib.htop; rightMeters [ + (bar "RightCPUs") + (bar "Swap") + (bar "DiskIO") + (text "Tasks") + (text "Uptime") + (text "Systemd") + ]); }; jq.enable = true; @@ -24,7 +67,7 @@ mosh tree vnstat file pv bc zip nmap aspell aspellDicts.de aspellDicts.en borgbackup man-pages rsync socat inetutils yq cached-nix-shell persistent-nix-shell rage - smartmontools hdparm nix-output-monitor + smartmontools hdparm nix-output-monitor wrappedLess ]; }; } -- cgit v1.2.3