fixed zsh package nonsense (i hate carapace)

This commit is contained in:
2026-07-04 16:11:10 +01:00
parent d28858fb45
commit a02f96f6ca
6 changed files with 270 additions and 39 deletions

View File

@@ -8,10 +8,20 @@
lib,
...
}: {
nixpkgs.overlays = [
(final: prev: {
zsh = self.packages.${pkgs.stdenv.hostPlatform.system}.myZsh;
})
];
programs.zsh = {
enable = true;
package = self.packages.${pkgs.stdenv.hostPlatform.system}.myZsh;
enableCompletion = true;
enableBashCompletion = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
histSize = 10000;
};
users.defaultUserShell = pkgs.zsh;
};
perSystem = {
pkgs,
@@ -22,26 +32,30 @@
packages = {
myZsh = inputs.wrappers.wrappers.zsh.wrap {
inherit pkgs;
runtimePkgs = [pkgs.carapace];
zshAliases = {
ls = lib.getExe pkgs.lsd;
cat = lib.getExe pkgs.bat;
lg = lib.getExe pkgs.lazygit;
devenv = lib.getExe pkgs.devenv;
carapace = lib.getExe pkgs.carapace;
man = "man -P \"${lib.getExe pkgs.bat} -p\"";
nsh = "nix-shell -p";
};
zshrc.content = ''
export CARAPACE_BRIDGES='zsh,fish,bash,inshellisense' # optional
autoload -U compinit && compinit
# export CARAPACE_BRIDGES='zsh,fish,bash,inshellisense' # optional
zstyle ':completion:*' format $'\e[2;37mCompleting %d\e[m'
source <(${pkgs.carapace}/bin/carapace _carapace)
source <(${lib.getExe pkgs.carapace} _carapace)
setopt NO_CASE_GLOB
zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
export EDITOR=nvim
eval "$(${pkgs.devenv}/bin/devenv hook zsh)"
eval "$(${self.packages.${pkgs.host.stdenv.hostPlatform.system}.ohMyPosh}/bin/oh-my-posh init zsh)"
eval "$(${lib.getExe pkgs.devenv} hook zsh)"
eval "$(${lib.getExe self.packages.${pkgs.host.stdenv.hostPlatform.system}.ohMyPosh} init zsh)"
${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin
${lib.getExe pkgs.any-nix-shell} zsh --info-right | source /dev/stdin
'';
};
ohMyPosh = inputs.wrappers.wrappers.oh-my-posh.wrap {