diff --git a/aspects/base/zsh.nix b/aspects/base/zsh.nix new file mode 100644 index 0000000..cad3309 --- /dev/null +++ b/aspects/base/zsh.nix @@ -0,0 +1,46 @@ +{ ... }: +{ + flake.modules = { + nixos.zsh = + { ... }: + { + programs.zsh.enable = true; + }; + homeManager.zsh = + { + config, + lib, + pkgs, + ... + }: + { + programs.zsh = { + enable = true; + dotDir = "${config.xdg.configHome}/zsh"; + autosuggestion = { + enable = true; + strategy = [ + "match_prev_cmd" + "completion" + ]; + }; + enableCompletion = true; + syntaxHighlighting.enable = true; + initExtra = '' + unsetopt beep + ${lib.getExe pkgs.nix-your-shell} zsh | source /dev/stdin + ''; + loginExtra = "${lib.getExe pkgs.nix-your-shell} zsh | source /dev/stdin"; + history = { + size = 10000; + save = 10000; + share = true; + }; + initExtraBeforeCompInit = '' + zstyle ':completion:*' menu select + zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' + ''; + }; + }; + }; +} diff --git a/aspects/systems/base.nix b/aspects/systems/base.nix index fdfc525..87091b4 100644 --- a/aspects/systems/base.nix +++ b/aspects/systems/base.nix @@ -13,6 +13,7 @@ nix security ssh + zsh ]; environment = { systemPackages = with pkgs; [ @@ -49,6 +50,7 @@ imports = with inputs.self.modules.homeManager; [ bash fish + zsh ]; }; }; diff --git a/aspects/systems/cli.nix b/aspects/systems/cli.nix index 2b95f0e..a9a4a32 100644 --- a/aspects/systems/cli.nix +++ b/aspects/systems/cli.nix @@ -28,6 +28,11 @@ starship tmux ]; + programs.zoxide = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + }; }; }; } diff --git a/aspects/users/user.nix b/aspects/users/user.nix index 86bcddb..7721995 100644 --- a/aspects/users/user.nix +++ b/aspects/users/user.nix @@ -11,7 +11,7 @@ in { users.users.user = { isNormalUser = true; - shell = pkgs.fish; + shell = pkgs.zsh; extraGroups = [ "networkmanager" "wheel"