diff --git a/configurations/host/Old-materusPC/configuration.nix b/configurations/host/Old-materusPC/configuration.nix index feecb22..564f9ee 100755 --- a/configurations/host/Old-materusPC/configuration.nix +++ b/configurations/host/Old-materusPC/configuration.nix @@ -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; diff --git a/configurations/host/materusPC/tmp.nix b/configurations/host/materusPC/tmp.nix index 42faa55..553b491 100644 --- a/configurations/host/materusPC/tmp.nix +++ b/configurations/host/materusPC/tmp.nix @@ -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; diff --git a/configurations/profile/home/shell/zsh.nix b/configurations/profile/home/shell/zsh.nix index 67c45d3..a519948 100644 --- a/configurations/profile/home/shell/zsh.nix +++ b/configurations/profile/home/shell/zsh.nix @@ -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(){ diff --git a/configurations/profile/os/default.nix b/configurations/profile/os/default.nix index 23b6c4e..30e0e52 100644 --- a/configurations/profile/os/default.nix +++ b/configurations/profile/os/default.nix @@ -3,7 +3,8 @@ imports = [ ./nix.nix ./fonts.nix - + + ./shell ./games ]; diff --git a/configurations/profile/os/shell/default.nix b/configurations/profile/os/shell/default.nix new file mode 100644 index 0000000..f9b4e10 --- /dev/null +++ b/configurations/profile/os/shell/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./zsh.nix + ]; + + +} diff --git a/configurations/profile/os/shell/zsh.nix b/configurations/profile/os/shell/zsh.nix new file mode 100644 index 0000000..87266e3 --- /dev/null +++ b/configurations/profile/os/shell/zsh.nix @@ -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 = '' + ''; + }; + }; +}