zsh: fix compdump cache issue for building zsh completions

This commit is contained in:
Tigor Hutasuhut 2024-07-08 13:54:03 +07:00
parent 95915cb1cf
commit e2861a968a
2 changed files with 10 additions and 5 deletions

View file

@ -1,16 +1,14 @@
{ config, lib, unstable, pkgs, ... }:
{ config, lib, ... }:
let
cfg = config.profile.go;
in
{
config = lib.mkIf cfg.enable {
programs.zsh.initExtra = ''zsh-defer source<(cat ${pkgs.zsh-completions}/share/zsh/site-functions/_golang)'';
programs.go = {
enable = true;
goPrivate = [
"gitlab.bareksa.com"
];
package = unstable.go_1_22;
};
};
}

View file

@ -11,6 +11,13 @@ in
];
programs.zsh = {
enable = true;
envExtra = /*bash*/ ''
# Disable loading global RC files in /etc/zsh/*
# Mostly because they are unneeded
# and global rc files has to be small for security reasons (no plugins)
# thus making them saver for Root account to load them.
unsetopt GLOBAL_RCS
'';
autosuggestion.enable = true;
enableCompletion = true;
defaultKeymap = "emacs";
@ -47,7 +54,7 @@ in
syntaxHighlighting.enable = true;
initExtraFirst = /*bash*/ ''
export ZSH_CACHE_DIR=$HOME/.cache/zsh
mkdir -p $ZSH_CACHE_DIR/completions
fpath+=${pkgs.zsh-completions}/share/zsh/site-functions
if [ -f $HOME/.config/zsh/.p10k.zsh ]; then
source $HOME/.config/zsh/.p10k.zsh