diff --git a/modules/impermanence/users.nix b/modules/impermanence/users.nix index 2b252a8..5df3bc8 100644 --- a/modules/impermanence/users.nix +++ b/modules/impermanence/users.nix @@ -70,6 +70,20 @@ in { flip mapAttrs hmUserCfg.home.persistence (_: sourceCfg: { users.${user} = { + # This needs to be set for allo users with non + # standart home (not /home/ + # due to nixpkgs it + # can't be deduced from homeDirectory + # as there will be infinite recursion + # If this setting is forgotten there + # are assertions in place warning you + home = + { + patrick = "/home/patrick"; + root = "/root"; + } + .${user} + or {}; files = mkUserFiles sourceCfg.files; directories = mkUserDirs sourceCfg.directories; }; diff --git a/users/common/shells/zsh/default.nix b/users/common/shells/zsh/default.nix index 378523f..9600de5 100644 --- a/users/common/shells/zsh/default.nix +++ b/users/common/shells/zsh/default.nix @@ -25,6 +25,7 @@ programs.nix-index.enable = true; programs.nix-index-database.comma.enable = true; + programs.zsh = { enable = true; dotDir = ".config/zsh"; @@ -35,6 +36,15 @@ share = false; }; initExtra = builtins.readFile ./zshrc; + # This needs to be loaded befor zsh-fast-syntax-highlighting + # is sourced as that overwrites all widgets to redraw with highlighting + initExtraBeforeCompInit = '' + if autoload history-search-end; then + zle -N history-beginning-search-backward-end history-search-end + zle -N history-beginning-search-forward-end history-search-end + fi + + ''; plugins = [ { name = "fzf-tab"; @@ -87,4 +97,7 @@ } ]; }; + home.persistence."/state".directories = [ + ".local/share/zsh" + ]; } diff --git a/users/common/shells/zsh/zshrc b/users/common/shells/zsh/zshrc index cb10bc8..6c7db57 100644 --- a/users/common/shells/zsh/zshrc +++ b/users/common/shells/zsh/zshrc @@ -97,12 +97,6 @@ function zshaddhistory() { emulate -L zsh [[ ! $1 =~ "$HISTORY_IGNORE_REGEX" ]] } - -if autoload history-search-end; then - zle -N history-beginning-search-backward-end history-search-end - zle -N history-beginning-search-forward-end history-search-end -fi - # Delete all keybinds and use emacs-like key bindings by default: bindkey -d bindkey -e