From cf565b894912c47611f8e80d00dcaf8a737622f7 Mon Sep 17 00:00:00 2001 From: Asmir A Date: Mon, 23 Mar 2026 10:48:04 +0100 Subject: [PATCH] fuji/home/zsh: recompile .zwc files when updating zsh --- home/common/zsh.nix | 12 +++++++++++- home/fuji/home.nix | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/home/common/zsh.nix b/home/common/zsh.nix index cdf130b..934ce8a 100644 --- a/home/common/zsh.nix +++ b/home/common/zsh.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ pkgs, lib, config, ... }: { home.sessionVariables = { /*ZDOTDIR = "\"$HOME/\".config/zsh";*/ @@ -117,4 +117,14 @@ fi ''; }; + + home.activation.zshRecompile = lib.mkIf config.programs.zsh.enable ( + lib.hm.dag.entryAfter [ "writeBoundary" ] '' + for f in "$HOME/.zshrc" "$HOME/.zshenv" "$HOME/.zprofile" "$HOME/.zlogin"; do + if [[ -f "$f" ]]; then + ${pkgs.zsh}/bin/zsh -c "zcompile $f" 2>/dev/null || true + fi + done + '' + ); } diff --git a/home/fuji/home.nix b/home/fuji/home.nix index 815fbaf..3eba3e0 100644 --- a/home/fuji/home.nix +++ b/home/fuji/home.nix @@ -1,5 +1,6 @@ { lib , pkgs +, config , ... }: let