home-profile & os-profile: zsh compinit changes

This commit is contained in:
Mateusz Słodkowicz 2024-04-01 22:52:49 +02:00
parent 0c31caf113
commit 47c8d1c4ea
Signed by: materus
SSH Key Fingerprint: SHA256:rzVduzTiiszuYfLPYD0SDZV+g8lxhpcRgpbOZA1X0Uo
6 changed files with 38 additions and 28 deletions

View File

@ -254,17 +254,6 @@
remotePlay.openFirewall = true;
};
fish.enable = true;
zsh = {
enable = true;
interactiveShellInit = ''
if [[ ''${__MATERUS_HM_ZSH:-0} == 0 ]]; then
source ${pkgs.grml-zsh-config}/etc/zsh/zshrc
fi
'';
promptInit = ''
'';
};
java.enable = true;
command-not-found.enable = false;
dconf.enable = true;

View File

@ -152,17 +152,6 @@
environment.shells = with pkgs; [ zsh bashInteractive fish ];
programs = {
fish.enable = true;
zsh = {
enable = true;
interactiveShellInit = ''
if [[ ''${__MATERUS_HM_ZSH:-0} == 0 ]]; then
source ${pkgs.grml-zsh-config}/etc/zsh/zshrc
fi
'';
promptInit = ''
'';
};
java.enable = true;
java.package = pkgs.graalvm-ce;
java.binfmt = true;

View File

@ -11,11 +11,10 @@ let
p10kcfg = "${zshcfg}/p10kcfg";
zshcfg = "${materusArg.cfg.path}" + "/extraFiles/config/zsh";
cfg = config.materus.profile.zsh;
#enableStarship = config.materus.starship.enable;
makeEnv = name: val: ''${name}=''${${name}:-"${val}"}'';
makeIfVar = var: val: ret: ''
if [ ''$${var} = "${val}" ]; then
if [[ "''$${var}" = "${val}" ]]; then
${ret}
fi
'';
@ -125,9 +124,14 @@ in
ignoreSpace = true;
};
completionInit = ''
ZSH_COMPDUMP="''${ZSH_COMPDUMP:-''${XDG_CACHE_HOME:-${config.home.homeDirectory}/.cache}/.zcompdump-''${HOST}-''${ZSH_VERSION}}"
autoload -U compinit && compinit -d $ZSH_COMPDUMP
'';
initExtra = ''
if [[ "$__ETC_ZSHRC_SOURCED" != "1" ]]; then
. ${zshcfg}/zinputrc
fi
source ${zshcfg}/zshcompletion.zsh
history-substring-search-up-prefixed(){

View File

@ -4,6 +4,7 @@
./nix.nix
./fonts.nix
./shell
./games
];

View File

@ -0,0 +1,7 @@
{
imports = [
./zsh.nix
];
}

View File

@ -0,0 +1,20 @@
{materusArg, config, pkgs, lib, ...}:
let
cfg = config.materus.profile.zsh;
in
{
options.materus.profile.zsh.enable = materusArg.pkgs.lib.mkBoolOpt true "Enable materus system zsh config";
config = lib.mkIf cfg.enable {
programs.zsh = {
enable = true;
enableGlobalCompInit=false;
interactiveShellInit = ''
if [[ ''${__MATERUS_HM_ZSH:-0} == 0 ]]; then
source ${pkgs.grml-zsh-config}/etc/zsh/zshrc
fi
'';
promptInit = ''
'';
};
};
}