Skip to content

Commit

Permalink
feat(home-manager): add support for fish (#46)
Browse files Browse the repository at this point in the history
Signed-off-by: Sefa Eyeoglu <[email protected]>
  • Loading branch information
Scrumplex authored Oct 22, 2023
1 parent 7513e5e commit 5713b47
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ in
./bat.nix
./bottom.nix
./btop.nix
./fish.nix
./kitty.nix
./lazygit.nix
./starship.nix
Expand Down
32 changes: 32 additions & 0 deletions modules/home-manager/fish.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{ config
, pkgs
, lib
, ...
}:
let
inherit (lib) ctp mkIf;
cfg = config.programs.fish.catppuccin;
enable = cfg.enable && config.programs.fish.enable;

theme = pkgs.fetchFromGitHub
{
owner = "catppuccin";
repo = "fish";
rev = "91e6d6721362be05a5c62e235ed8517d90c567c9";
sha256 = "sha256-l9V7YMfJWhKDL65dNbxaddhaM6GJ0CFZ6z+4R6MJwBA=";
};
themeName = "Catppuccin ${ctp.mkUpper cfg.flavour}";
in
{
options.programs.fish.catppuccin = lib.ctp.mkCatppuccinOpt "fish" config;

# xdg is required for this to work
config = mkIf enable {
xdg.enable = lib.mkForce true;

programs.fish.shellInit = ''
fish_config theme choose "${themeName}"
'';
xdg.configFile."fish/themes/${themeName}.theme".source = "${theme}/themes/${themeName}.theme";
};
}

0 comments on commit 5713b47

Please sign in to comment.