chore(nixos): simplify switch recipe aliases

This commit is contained in:
2026-02-20 01:45:59 -08:00
committed by Kat Huang
parent 2ccdfdf1ad
commit 6b484de128

View File

@@ -1,24 +1,16 @@
switch *args: switch *args:
# Avoid "Unit nixos-rebuild-switch-to-configuration.service was already loaded" sudo nixos-rebuild switch --flake ".#" --impure --option warn-dirty false {{args}}
# when another switch is still running.
bash -lc 'if systemctl is-active --quiet nixos-rebuild-switch-to-configuration.service; then \ switch-remote *args:
echo "nixos-rebuild switch already running; waiting..." >&2; \ # Switch using the remote master flake.
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 {{args}} sudo nixos-rebuild switch --flake "git+https://github.com/colonelpanic8/dotfiles.git?ref=master&dir=nixos#" --impure --option warn-dirty false {{args}}
switch-local *args: switch-local *args:
# Switch using the local working tree (includes uncommitted edits). # Backwards-compat alias for local switch.
bash -lc 'if systemctl is-active --quiet nixos-rebuild-switch-to-configuration.service; then \
echo "nixos-rebuild switch already running; waiting..." >&2; \
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 ".#" --impure --option warn-dirty false {{args}} sudo nixos-rebuild switch --flake ".#" --impure --option warn-dirty false {{args}}
switch-local-taffybar *args: switch-local-taffybar *args:
# Like `switch`, but use the local taffybar checkout (useful when hacking on it). # Like `switch-remote`, but use the local taffybar checkout (useful when hacking on it).
# Note: requires the submodule/checkout to exist at ../dotfiles/config/taffybar/taffybar. # Note: requires the submodule/checkout to exist at ../dotfiles/config/taffybar/taffybar.
bash -lc 'if systemctl is-active --quiet nixos-rebuild-switch-to-configuration.service; then \ bash -lc 'if systemctl is-active --quiet nixos-rebuild-switch-to-configuration.service; then \
echo "nixos-rebuild switch already running; waiting..." >&2; \ echo "nixos-rebuild switch already running; waiting..." >&2; \