ctucx.git: nixfiles

ctucx' nixfiles

commit b6731e47018c74d09b30856c18d05f0aa78811a2
parent d39e5f7c50c7b780fc411ac41261c6abb930fc5d
Author: Leah (ctucx) <leah@ctu.cx>
Date: Mon, 11 Oct 2021 00:48:30 +0200

programs/htop: move to own file, use overlay to remove desktop-entry, use home-managers htop module to generate config, set some useful default settings
3 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/configurations/common.nix b/configurations/common.nix
@@ -8,6 +8,7 @@
     ./programs/cli/micro.nix
     ./programs/cli/ssh.nix
     ./programs/cli/tmux.nix
+    ./programs/cli/htop.nix
     ./programs/cli/utilities.nix
   ];
 
diff --git a/configurations/programs/cli/htop.nix b/configurations/programs/cli/htop.nix
@@ -0,0 +1,27 @@
+{ config, pkgs, lib, ... }:
+
+{
+  nixpkgs.overlays = [
+    (self: super: {
+      htop = super.htop.overrideAttrs(oldAttrs: {
+          postInstall = ''
+            rm $out/share/applications/htop.desktop
+          '';
+        });
+    })
+  ];
+
+  home-manager.users.leah = {
+    programs = {
+      htop = {
+        enable   = true;
+        settings = {
+          hide_threads       = 1;
+          tree_view          = 1;
+          show_program_path  = 0;
+          show_cpu_frequency = 1;
+        };
+      };
+    };
+  };
+}
diff --git a/configurations/programs/cli/utilities.nix b/configurations/programs/cli/utilities.nix
@@ -1,13 +1,6 @@
 { config, pkgs, lib, ... }:
 
-let
-  htopNoDesktop = pkgs.htop.overrideAttrs(oldAttrs: {
-    postInstall = ''
-      rm $out/share/applications/htop.desktop
-    '';
-  });
-
-in {
+{
   home-manager.users.leah = {
     home = {
       packages = with pkgs; [

@@ -15,8 +8,6 @@ in {
         curl
         rsync
 
-        htopNoDesktop
-
         dnsutils
 
         usbutils

@@ -24,8 +15,6 @@ in {
     };
 
     programs = {
-#      htop.enable     = true;
-
       bat.enable      = true;
 
       jq.enable       = true;