diff --git a/nix/home/yt/chunk.nix b/nix/home/yt/chunk.nix index 3f406a5..b4c2863 100644 --- a/nix/home/yt/chunk.nix +++ b/nix/home/yt/chunk.nix @@ -6,6 +6,9 @@ outputs, ... }: { + imports = [ + ./zsh + ]; home = { username = "yt"; homeDirectory = "/home/yt"; diff --git a/nix/home/yt/ytnix.nix b/nix/home/yt/ytnix.nix index 9e2a5dd..f69a003 100644 --- a/nix/home/yt/ytnix.nix +++ b/nix/home/yt/ytnix.nix @@ -6,6 +6,9 @@ outputs, ... }: { + imports = [ + ./zsh + ]; home = { username = "yt"; homeDirectory = "/home/yt"; diff --git a/nix/home/yt/zsh/default.nix b/nix/home/yt/zsh/default.nix new file mode 100644 index 0000000..d6df014 --- /dev/null +++ b/nix/home/yt/zsh/default.nix @@ -0,0 +1,76 @@ +{ + config, + lib, + inputs, + ... +}: { + programs.zsh = { + enable = true; + autosuggestion = { + enable = true; + strategy = [ "history" "completion" ]; + }; + syntaxHighlighting = { + enable = true; + highlighters = [ "brackets" "cursor" ]; + }; + autocd = true; + defaultKeymap = "emacs"; + antidote = { + enable = true; + useFriendlyNames = true; # why not? + plugins = [ + "zsh-users/zsh-completions" + "romkatv/powerlevel10k" + "Aloxaf/fzf-tab" + "z-shell/zsh-eza" + "ohmyzsh/ohmyzsh path:plugins/colored-man-pages" + "ohmyzsh/ohmyzsh path:plugins/git" + ]; + }; + history = { + ignoreDups = true; + ignoreAllDups = true; + ignoreSpace = true; + save = 50000; + size = 50000; + append = true; + }; + historySubstringSearch= { + enable = true; + searchUpKey = "^p"; + searchDownKey = "^n"; + }; + initExtra = '' + source ${./p10k.zsh} + zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' + zstyle ':completion:*' menu no + zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls $realpath' + zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-prewview 'ls $realpath' + ''; + shellAliases = { + "vi" = "nvim"; + "vim" = "nvim"; + "t" = "tmux"; + "tl" = "tmux list-sessions"; + "ta" = "tmux new-session -A -s"; + "se" = "sudoedit"; + "s" = "sudo"; + "nrs" = "sudo nixos-rebuild switch --flake ."; + "nrt" = "sudo nixos-rebuild test --flake ."; + }; + sessionVariables = { + "FZF_DEFAULT_COMMAND" = "rg"; + }; + }; + + programs.fzf = { + enable = true; + enableZshIntegration = true; + }; + + programs.zoxide = { + enable = true; + enableZshIntegration = true; + }; +} diff --git a/p10k.zsh b/nix/home/yt/zsh/p10k.zsh similarity index 99% rename from p10k.zsh rename to nix/home/yt/zsh/p10k.zsh index 4fab346..f59ff77 100644 --- a/p10k.zsh +++ b/nix/home/yt/zsh/p10k.zsh @@ -179,7 +179,7 @@ # - verbose: Enable instant prompt and print a warning when detecting console output during # zsh initialization. Choose this if you've never tried instant prompt, haven't # seen the warning, or if you are unsure what this all means. - typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose + typeset -g POWERLEVEL9K_INSTANT_PROMPT=off # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload diff --git a/nix/hosts/chunk/default.nix b/nix/hosts/chunk/default.nix index 685ad90..3885bfd 100644 --- a/nix/hosts/chunk/default.nix +++ b/nix/hosts/chunk/default.nix @@ -69,7 +69,6 @@ in { }; users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPdhAQYy0+vS+QmyCd0MAbqbgzyMGcsuuFyf6kg2yKge yt@ytlinux" ]; - programs.zsh.enable = true; users.users.git = { isNormalUser = true; diff --git a/nix/hosts/ytnix/default.nix b/nix/hosts/ytnix/default.nix index 240ebdd..4e5b91e 100644 --- a/nix/hosts/ytnix/default.nix +++ b/nix/hosts/ytnix/default.nix @@ -131,7 +131,6 @@ enable = true; wayland.enable = true; }; - programs.zsh.enable = true; # security.sudo.wheelNeedsPassword = false; fonts.packages = with pkgs; [