fix(taffybar): make live checkout opt-in

This commit is contained in:
2026-03-30 12:36:22 -07:00
committed by Kat Huang
parent 13f446e685
commit a4e3a50db0
2 changed files with 12 additions and 8 deletions

View File

@@ -46,17 +46,20 @@
config.allowBroken = true;
};
# Exclude local worktree/build artifacts from the source we feed to
# callCabal2nix. cleanSource alone still includes .worktrees/.
# Use the live local checkout directly so Nix picks up dirty nested-repo
# changes while iterating on the vendored taffybar stack.
localTaffybarCheckout = /home/imalison/dotfiles/dotfiles/config/taffybar/taffybar;
# Default to the flake input so normal NixOS rebuilds stay pinned and
# reproducible. switch-local-taffybar opts into the live checkout via
# IMALISON_TAFFYBAR_LIVE_CHECKOUT when iterating on the vendored stack.
liveTaffybarCheckout = builtins.getEnv "IMALISON_TAFFYBAR_LIVE_CHECKOUT";
taffybarSourceRoot =
if liveTaffybarCheckout != ""
then /. + liveTaffybarCheckout
else taffybar.outPath;
cleanedTaffybarSource = pkgs.lib.cleanSourceWith {
src = localTaffybarCheckout;
src = taffybarSourceRoot;
filter = path: type:
let
relPath = pkgs.lib.removePrefix "${toString localTaffybarCheckout}/" (toString path);
relPath = pkgs.lib.removePrefix "${toString taffybarSourceRoot}/" (toString path);
excludedTopLevel = [ ".worktrees" ".direnv" "dist" "dist-newstyle" "result" ];
isExcluded = pkgs.lib.lists.any
(prefix: relPath == prefix || pkgs.lib.hasPrefix "${prefix}/" relPath)

View File

@@ -17,7 +17,8 @@ switch-local-taffybar *args:
systemctl status nixos-rebuild-switch-to-configuration.service --no-pager >&2 || true; \
while systemctl is-active --quiet nixos-rebuild-switch-to-configuration.service; do sleep 1; done; \
fi'
sudo nixos-rebuild switch --flake "git+https://github.com/colonelpanic8/dotfiles.git?ref=master&dir=nixos#" --impure --option warn-dirty false \
sudo env IMALISON_TAFFYBAR_LIVE_CHECKOUT=/home/imalison/dotfiles/dotfiles/config/taffybar/taffybar \
nixos-rebuild switch --flake "git+https://github.com/colonelpanic8/dotfiles.git?ref=master&dir=nixos#" --impure --option warn-dirty false \
--override-input taffybar git+file:///home/imalison/dotfiles/dotfiles/config/taffybar/taffybar \
{{args}}