aboutsummaryrefslogtreecommitdiffstats
path: root/modules/system/btop
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar@gmail.com>2026-09-24 04:02:19 +0530
committerArpit Chakladar <arpitchakladar@gmail.com>2026-09-24 04:02:19 +0530
commit5ea8c30b7b82d4c1e7164541892066b1f24f7d22 (patch)
treead9b994cc5415f63bae1f2342f520756d43c67ce /modules/system/btop
parentad96214c9ab94bce925000a6059e3c68e2ff6a22 (diff)
parent748669e19daa3afc8f0cfe10eedc19ae9766ed2c (diff)
downloadhome-manager-config-5ea8c30b7b82d4c1e7164541892066b1f24f7d22.tar.gz
home-manager-config-5ea8c30b7b82d4c1e7164541892066b1f24f7d22.zip
Merge branch 'massive-refactoring'
Diffstat (limited to 'modules/system/btop')
-rw-r--r--modules/system/btop/default.nix37
1 files changed, 28 insertions, 9 deletions
diff --git a/modules/system/btop/default.nix b/modules/system/btop/default.nix
index 4f84036..453bafb 100644
--- a/modules/system/btop/default.nix
+++ b/modules/system/btop/default.nix
@@ -1,39 +1,58 @@
# Cross-platform graphical process and system monitor
{
config,
- pkgs,
lib,
+ pkgs,
...
}:
+let
+ cfg = config.system.btop;
+in
{
imports = [ ./assertions.nix ];
options.system.btop = {
enable = lib.mkEnableOption "Enables btop.";
- nvidia.enable = lib.mkEnableOption "Build btop with NVIDIA GPU monitoring support (CUDA).";
- amd.enable = lib.mkEnableOption "Build btop with AMD GPU monitoring support (ROCm).";
+ nvidia = lib.mkOption {
+ type = lib.types.submodule {
+ options = {
+ enable = lib.mkEnableOption "Build btop with NVIDIA GPU monitoring support (CUDA).";
+ };
+ };
+ default = { };
+ description = "NVIDIA GPU monitoring configuration.";
+ };
+ amd = lib.mkOption {
+ type = lib.types.submodule {
+ options = {
+ enable = lib.mkEnableOption "Build btop with AMD GPU monitoring support (ROCm).";
+ };
+ };
+ default = { };
+ description = "AMD GPU monitoring configuration.";
+ };
package = lib.mkOption {
type = lib.types.package;
readOnly = true;
default = pkgs.btop.override {
- cudaSupport = config.system.btop.nvidia.enable;
- rocmSupport = config.system.btop.amd.enable;
+ cudaSupport = cfg.nvidia.enable;
+ rocmSupport = cfg.amd.enable;
};
description = "The btop package to use.";
};
};
config = lib.mkMerge [
- (lib.mkIf config.system.btop.enable {
+ (lib.mkIf cfg.enable {
programs.btop = {
enable = true;
- package = config.system.btop.package;
+ package = cfg.package;
};
})
- (lib.mkIf (config.system.btop.enable && config.terminal.kitty.enable) {
+ (lib.mkIf (cfg.enable && config.terminal.kitty.enable) {
xdg.desktopEntries."btop" = {
name = "btop++";
- exec = "${lib.getExe config.terminal.kitty.package} --class btop -e ${lib.getExe config.system.btop.package}";
+ exec = "${lib.getExe config.terminal.kitty.package} --class btop -e ${lib.getExe cfg.package}";
icon = "btop";
categories = [
"System"