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; remotePlay.openFirewall = true;
}; };
fish.enable = 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; java.enable = true;
command-not-found.enable = false; command-not-found.enable = false;
dconf.enable = true; dconf.enable = true;

View File

@ -152,17 +152,6 @@
environment.shells = with pkgs; [ zsh bashInteractive fish ]; environment.shells = with pkgs; [ zsh bashInteractive fish ];
programs = { programs = {
fish.enable = 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; java.enable = true;
java.package = pkgs.graalvm-ce; java.package = pkgs.graalvm-ce;
java.binfmt = true; java.binfmt = true;

View File

@ -11,12 +11,11 @@ let
p10kcfg = "${zshcfg}/p10kcfg"; p10kcfg = "${zshcfg}/p10kcfg";
zshcfg = "${materusArg.cfg.path}" + "/extraFiles/config/zsh"; zshcfg = "${materusArg.cfg.path}" + "/extraFiles/config/zsh";
cfg = config.materus.profile.zsh; cfg = config.materus.profile.zsh;
#enableStarship = config.materus.starship.enable;
makeEnv = name: val: ''${name}=''${${name}:-"${val}"}''; makeEnv = name: val: ''${name}=''${${name}:-"${val}"}'';
makeIfVar = var: val: ret: '' makeIfVar = var: val: ret: ''
if [ ''$${var} = "${val}" ]; then if [[ "''$${var}" = "${val}" ]]; then
${ret} ${ret}
fi fi
''; '';
@ -125,9 +124,14 @@ in
ignoreSpace = true; 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 = '' initExtra = ''
. ${zshcfg}/zinputrc if [[ "$__ETC_ZSHRC_SOURCED" != "1" ]]; then
. ${zshcfg}/zinputrc
fi
source ${zshcfg}/zshcompletion.zsh source ${zshcfg}/zshcompletion.zsh
history-substring-search-up-prefixed(){ history-substring-search-up-prefixed(){

View File

@ -3,7 +3,8 @@
imports = [ imports = [
./nix.nix ./nix.nix
./fonts.nix ./fonts.nix
./shell
./games ./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 = ''
'';
};
};
}