feat(home-manager): add support for zsh-syntax-highlighting (#146)

Co-authored-by: seth <getchoo@tuta.io>
This commit is contained in:
XYenon 2024-05-02 07:53:50 +08:00 committed by GitHub
parent 112cef79d9
commit ef2f0d91ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 59 additions and 0 deletions

View file

@ -718,5 +718,25 @@
"type": "github"
},
"version": "0adc53028d81bf047461bc61c43a484d11b15220"
},
"zsh-syntax-highlighting": {
"cargoLocks": null,
"date": "2022-10-12",
"extract": null,
"name": "zsh-syntax-highlighting",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "catppuccin",
"repo": "zsh-syntax-highlighting",
"rev": "06d519c20798f0ebe275fc3a8101841faaeee8ea",
"sha256": "sha256-Q7KmwUd9fblprL55W0Sf4g7lRcemnhjh4/v+TacJSfo=",
"type": "github"
},
"version": "06d519c20798f0ebe275fc3a8101841faaeee8ea"
}
}

View file

@ -433,4 +433,16 @@
};
date = "2024-04-04";
};
zsh-syntax-highlighting = {
pname = "zsh-syntax-highlighting";
version = "06d519c20798f0ebe275fc3a8101841faaeee8ea";
src = fetchFromGitHub {
owner = "catppuccin";
repo = "zsh-syntax-highlighting";
rev = "06d519c20798f0ebe275fc3a8101841faaeee8ea";
fetchSubmodules = false;
sha256 = "sha256-Q7KmwUd9fblprL55W0Sf4g7lRcemnhjh4/v+TacJSfo=";
};
date = "2022-10-12";
};
}

View file

@ -0,0 +1,20 @@
{ config
, lib
, sources
, ...
}:
let
inherit (lib) ctp;
cfg = config.programs.zsh.syntaxHighlighting.catppuccin;
enable = cfg.enable && config.programs.zsh.syntaxHighlighting.enable;
in
{
options.programs.zsh.syntaxHighlighting.catppuccin =
ctp.mkCatppuccinOpt "zsh syntax highlighting";
config.programs.zsh = lib.mkIf enable {
initExtra = lib.mkBefore ''
source '${sources.zsh-syntax-highlighting}/themes/catppuccin_${cfg.flavour}-zsh-syntax-highlighting.zsh'
'';
};
}

View file

@ -141,3 +141,7 @@ fetch.github = "catppuccin/yazi"
[zathura]
src.git = "https://github.com/catppuccin/zathura.git"
fetch.github = "catppuccin/zathura"
[zsh-syntax-highlighting]
src.git = "https://github.com/catppuccin/zsh-syntax-highlighting.git"
fetch.github = "catppuccin/zsh-syntax-highlighting"

View file

@ -88,6 +88,9 @@ testers.runNixOSTest {
yazi = enable;
zathura = enable;
zellij = enable;
zsh = enable // {
syntaxHighlighting = enable;
};
};
gtk = lib.recursiveUpdate enable { catppuccin.cursor.enable = true; };