{ pkgs, ... }: { # see https://starship.rs/fr-fr/installing/#declaration-utilisateur-unique-via-home-manager programs.starship = { enable = true; enableZshIntegration = true; }; # Remplace fasd (retiré de nixpkgs, archivé upstream) programs.zoxide = { enable = true; enableZshIntegration = true; }; programs.zsh = { enable = true; autosuggestion = { enable = true; }; enableCompletion = true; history = { ignoreDups = true; save = 100000000000; size = 100000000000; }; oh-my-zsh = { enable = true; theme = "robbyrussell"; plugins = [ "docker" "git" "httpie" "pass" "ssh-agent" ]; extraConfig = '' zstyle :omz:plugins:ssh-agent lazy yes ''; }; # `$` must be escaped with `''` :metal: # source: https://nixos.org/nix-dev/2015-December/019018.html initContent = '' bindkey ' ' forward-word zstyle ':completion:*:hosts' hosts ''${=''${''${''${''${(@M)''${(f)"$(cat ~/.ssh/config 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}} setopt PROMPT_CR setopt PROMPT_SP m2wipe() { echo "Pouf pouf pouf…" sudo rm -rf $1/generated $1/var/cache/**/* $1/pub/static/* $1/var/page_cache $1/var/view_preprocessed mkdir $1/generated sudo chmod -R 777 $1/{var,pub,generated,app/etc} echo "… tchak !" } akamai() { # see https://gist.github.com/saml/4758360 curl -v -s -H "Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-ser" "$1" 2>&1 > /dev/null } lh() { CHROME_PATH=$(which google-chrome) pnpm dlx lighthouse $1 --view } # see https://github.com/cantino/mcfly export MCFLY_FUZZY=true eval "$(mcfly init zsh)" eval "$(op completion zsh)"; compdef _op op eval "$(logcli --completion-script-zsh)" # K8s source <(helm completion zsh) source <(k3d completion zsh) source <(kubectl completion zsh) source <(k9s completion zsh); compdef _k9s k9s # https://github.com/Schniz/fnm#shell-setup eval "$(fnm env --use-on-cd --shell zsh)" # Claude Code branché sur le serveur IA Lundi Matin (LM-Code). # La clé API est lue depuis ~/.config/lmc-token (non versionné). lmc() { local token_file="$HOME/.config/lmc-token" if [ ! -f "$token_file" ]; then echo "lmc: clé manquante — créez $token_file avec votre clé sk-XXXXX" >&2 return 1 fi ANTHROPIC_BASE_URL="https://llm-core.lundimatin.app" \ ANTHROPIC_AUTH_TOKEN="$(cat "$token_file")" \ ANTHROPIC_MODEL="LM-Code" \ ANTHROPIC_CUSTOM_MODEL_OPTION="LM-Code" \ ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="LM-Code - LundiMatin" \ claude "$@" } ''; sessionVariables = { EDITOR = "vim"; ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=7"; TERMINAL = "sakura"; PATH = "$PATH:$HOME/.npm/bin:$HOME/.local/bin"; # Use a local Cypress binary instead of the one installed by the CLI (not usable on NixOS) # see https://github.com/NixOS/nixpkgs/pull/56387 and https://discourse.nixos.org/t/cypress-with-npm/15137/4 HUSKY = 0; CYPRESS_INSTALL_BINARY = 0; CYPRESS_RUN_BINARY = "$HOME/.nix-profile/bin/Cypress"; LD_LIBRARY_PATH = "${pkgs.libgcc}/lib"; }; shellAliases = { # `z` et `zi` viennent de zoxide, les alias ci-dessous gardent les # raccourcis hérités de fasd (retiré de nixpkgs, archivé upstream) d = "zoxide query --list"; # directory j = "z"; # cd, same functionality as j in autojump sd = "zi"; # interactive directory selection zz = "zi"; # cd with interactive selection s = "fzf"; # show / search / select f = "fzf"; # file sf = "fzf"; # interactive file selection dc = "docker compose"; dcr = "docker compose run --rm"; dcrm = "docker compose rm -fsv"; copy = "xclip -selection c"; bepo = "setxkbmap -layout fr -variant bepo"; fr = "setxkbmap -layout fr -variant oss"; m = "make"; t = "task"; k = "kubectl --context build"; kb9 = "k9s --context build"; kp = "kubectl --context prod-eu7"; kp9 = "k9s --context prod-eu7"; g = "git"; gui = "gitui"; htop = "btop"; c = "claude"; p = "CLAUDE_CONFIG_DIR=~/.claude-perso claude"; }; }; }