summaryrefslogtreecommitdiff
path: root/user-profiles/utils.nix
blob: 5990c67fba108784d39ce8dd4b168e68964f55ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{ 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;
          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;
    };

    home.sessionVariables = {
      LESSCOLORIZER = "pygmentize -O style=rrt";
    };

    home.packages = with pkgs; [
      autossh usbutils pciutils eza silver-searcher pwgen xkcdpass
      unzip magic-wormhole qrencode tty-clock dnsutils openssl sshfs
      psmisc 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 wrappedLess dscp
    ];
  };
}