home-profile & os-profile: zsh compinit changes

This commit is contained in:
2024-04-01 22:52:49 +02:00
parent 0c31caf113
commit 47c8d1c4ea
6 changed files with 38 additions and 28 deletions
@@ -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;
-11
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;
+9 -5
View File
@@ -11,12 +11,11 @@ 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
${ret}
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 = ''
. ${zshcfg}/zinputrc
if [[ "$__ETC_ZSHRC_SOURCED" != "1" ]]; then
. ${zshcfg}/zinputrc
fi
source ${zshcfg}/zshcompletion.zsh
history-substring-search-up-prefixed(){
+2 -1
View File
@@ -3,7 +3,8 @@
imports = [
./nix.nix
./fonts.nix
./shell
./games
];
@@ -0,0 +1,7 @@
{
imports = [
./zsh.nix
];
}
+20
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 = ''
'';
};
};
}