Skip to content

Commit

Permalink
feat(home-manager): add support for btop (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
getchoo authored Apr 16, 2023
1 parent c5eeae7 commit 25edfe9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions modules/home-manager/btop.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{ config, pkgs, lib, ... }:
let
cfg = config.programs.btop.catppuccin;
themePath = "/themes/catppuccin_${cfg.flavour}.theme";
theme = pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "btop";
rev = "7109eac2884e9ca1dae431c0d7b8bc2a7ce54e54";
sha256 = "sha256-QoPPx4AzxJMYo/prqmWD/CM7e5vn/ueyx+XQ5+YfHF8=";
} + themePath;
in {
options.programs.btop.catppuccin = with lib; {
enable = mkEnableOption "Catppuccin theme";
flavour = mkOption {
type = types.enum [ "latte" "frappe" "macchiato" "mocha" ];
default = config.catppuccin.flavour;
description = "Catppuccin flavour for btop";
};
};

# xdg is required for this to work
config.xdg.enable = with lib; mkIf cfg.enable (mkForce true);

config.xdg.configFile."btop${themePath}".source = with lib;
mkIf cfg.enable theme;

config.programs.btop.settings.color_theme = with lib;
mkIf cfg.enable "${config.xdg.configHome + "/btop/${themePath}"}";
}
1 change: 1 addition & 0 deletions modules/home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
./alacritty.nix
./bat.nix
./bottom.nix
./btop.nix
./kitty.nix
./starship.nix
./helix.nix
Expand Down

0 comments on commit 25edfe9

Please sign in to comment.