refactor(nix): improve zsh compinit handling
Some checks failed
Check Formatting of Files / Check-Formatting (push) Has been cancelled
Some checks failed
Check Formatting of Files / Check-Formatting (push) Has been cancelled
This commit is contained in:
parent
cfecd96017
commit
2f9e7a94f6
@ -2,7 +2,10 @@
|
||||
{
|
||||
programs = {
|
||||
dconf.enable = true;
|
||||
zsh.enable = true;
|
||||
zsh = {
|
||||
enable = true;
|
||||
enableGlobalCompInit = false;
|
||||
};
|
||||
nix-ld.enable = true;
|
||||
};
|
||||
}
|
||||
|
@ -2,9 +2,7 @@
|
||||
{
|
||||
programs.password-store = {
|
||||
enable = true;
|
||||
package = pkgs.pass.withExtensions(exts: [
|
||||
exts.pass-file
|
||||
]);
|
||||
package = pkgs.pass.withExtensions (exts: [ exts.pass-file ]);
|
||||
settings = {
|
||||
PASSWORD_STORE_KEY = "C3FADDE7A8534BEB";
|
||||
};
|
||||
|
23
users/price/conf/zsh/default.nix
Normal file
23
users/price/conf/zsh/default.nix
Normal file
@ -0,0 +1,23 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
completionInit = ''
|
||||
() {
|
||||
autoload -U compinit
|
||||
local zsh_cache="''${XDG_CACHE_HOME:-$HOME}/zsh/"
|
||||
if [[ ! -d "$zsh_cache" ]]; then
|
||||
mkdir -p "$zsh_cache"
|
||||
fi
|
||||
local _comp_files=($zsh_cache/zcompcache(Nm-20))
|
||||
if (( $#_comp_files )); then
|
||||
compinit -i -C -d "$zsh_cache/zcompcache"
|
||||
else
|
||||
compinit -i -d "$zsh_cache/zcompcache"
|
||||
fi
|
||||
}
|
||||
'';
|
||||
initExtra = builtins.readFile ./init-extra.zsh;
|
||||
};
|
||||
}
|
5
users/price/conf/zsh/init-extra.zsh
Normal file
5
users/price/conf/zsh/init-extra.zsh
Normal file
@ -0,0 +1,5 @@
|
||||
() {
|
||||
if [[ -n "$XDG_CONFIG_HOME" && -r "$XDG_CONFIG_HOME/zsh/zsh" ]]; then
|
||||
source "$XDG_CONFIG_HOME/zsh/zsh"
|
||||
fi
|
||||
}
|
@ -261,13 +261,6 @@ in
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
};
|
||||
zsh = {
|
||||
enable = true;
|
||||
initExtra = ''
|
||||
__HM_SESS_VARS_SOURCED= source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
source "$HOME/.config/zsh/zsh"
|
||||
'';
|
||||
};
|
||||
git = {
|
||||
enable = true;
|
||||
userName = "Price Hiller";
|
||||
|
Loading…
Reference in New Issue
Block a user