╰─❯ cat /etc/nixos/home-manager/zsh.nix { config, lib, pkgs, ... }: { home-manager.users.sinc = { pkgs, ... }: { home.packages = [ pkgs.meslo-lgs-nf pkgs.zsh-powerlevel10k ]; programs = { # Set up zsh zsh = { enable = true; # Treat directory names as paths to cd to autocd = true; # Enable zsh autosuggestions enableAutosuggestions = true; # Configure shell history history = { # Remove duplicates before unique lines expireDuplicatesFirst = true; # Store timestamps along with commands extended = true; # Skip logging duplicate lines ignoreDups = true; # Skip logging lines prefixed with a space ignoreSpace = true; # Number of lines to save save = 100000; size = 100000; # Share history between sessions share = true; }; # Prepend these lines to .zshrc initExtraFirst = '' ZSH_DISABLE_COMPFIX=true ''; # Append these lines to .zshrc initExtra = '' source "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme" if [[ "$(tty)" =~ '/dev/tty[0-9]*' ]] || [[ "$([[ -n "$\{TMUX+set}" ]] && tmux display-message -p "#S" 2>/dev/null)" == "watchme" ]]; then source "$HOME/.p10k_pure.zsh" else source "$HOME/.p10k.zsh" fi zstyle ''\':completion:*''\' menu select zstyle ''\':completion:*''\' rehash true zstyle ''\':completion:*:git-checkout:*''\' sort false zstyle ''\':completion:*:descriptions''\' format ''\'[%d]''\' zstyle ':fzf-tab:*' switch-group ''\',''\' ''\'.''\' LANG="en_US.UTF-8" PATH="$PATH:$HOME/go/bin:$HOME/bin" NIX_BUILD_SHELL="zsh" ''; # Enable oh-my-zsh plugins oh-my-zsh = { enable = true; plugins = [ "git" "sudo" "tmux" "history" "common-aliases" "systemd" ]; }; # Fetch plugins from github plugins = [ { name = "fzf-tab"; file = "fzf-tab.plugin.zsh"; src = builtins.fetchGit { url = "https://github.com/Aloxaf/fzf-tab"; ref = "master"; }; } { name = "fast-syntax-highlighting"; file = "fast-syntax-highlighting.plugin.zsh"; src = builtins.fetchGit { url = "https://github.com/zdharma-continuum/fast-syntax-highlighting"; ref = "master"; }; } { name = "zsh-completions"; file = "zsh-completions.plugin.zsh"; src = builtins.fetchGit { url = "https://github.com/zsh-users/zsh-completions"; ref = "master"; }; } { name = "zsh-nix-shell"; file = "nix-shell.plugin.zsh"; src = builtins.fetchGit { url = "https://github.com/chisui/zsh-nix-shell"; ref = "master"; }; } { name = "zsh-z"; file = "zsh-z.plugin.zsh"; src = builtins.fetchGit { url = "https://github.com/agkozak/zsh-z"; ref = "master"; }; } ]; # Configure shell aliases shellAliases = { portcheck = ''sudo ${pkgs.lsof}/bin/lsof -i -P -n | ${pkgs.ripgrep}/bin/rg LISTEN''; send = ''$HOME/bin/send -u "https://send.seedno.de/$(hostname)" -p8090''; ssh = ''TERM=xterm-256color ${pkgs.openssh}/bin/ssh''; sudo = ''sudo --preserve-env=PATH env ''; swaymsg = ''${pkgs.sway}/bin/swaymsg''; wg = ''sudo ${pkgs.wireguard-tools}/bin/wg''; }; }; }; }; }