feat(home-manager): add support for fish (#46)

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2023-10-22 21:28:28 +02:00 committed by GitHub
parent 7513e5edf8
commit 5713b478b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 0 deletions

View file

@ -15,6 +15,7 @@ in
./bat.nix
./bottom.nix
./btop.nix
./fish.nix
./kitty.nix
./lazygit.nix
./starship.nix

View file

@ -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";
};
}