Files
Nix-Vibe/justfile
T

65 lines
2.1 KiB
Makefile

# Nix-Vibe task runner (see AGENTS.md for the underlying workflows)
set shell := ["zsh", "-c"]
# Apply a host's NixOS config, then relaunch QuickShell so it loads the freshly
# built shell.qml (deployed to ~/.config/quickshell as a store symlink — the
# live-reload watcher misses the new path, so a manual restart is required).
# Usage: just [hostname] — defaults to x1carbon.
default host='x1carbon':
#!/usr/bin/env bash
set -euo pipefail
sudo nixos-rebuild switch --flake ".#{{host}}"
if pgrep -f "[H]yprland" >/dev/null 2>&1; then
# comm name is ".quickshell-wra" (kernel-truncated from .quickshell-wrapped);
# -x avoids matching this recipe's own argv.
pkill -x .quickshell-wra || true
sleep 1
QS=quic"kshell"
command "$QS" >/dev/null 2>&1 &
disown || true
echo "quickshell relaunched"
else
echo "no Hyprland session on this host; skipped quickshell restart"
fi
# ===== pre-commit workflow =====
# Format the tree (nixfmt, as declared by the flake formatter).
format:
nix fmt
# Stage new files (flake only evaluates git-tracked files), then flake check.
check:
git add -A
nix flake check
# ===== deployment helpers (no quickshell restart) =====
# Build and test a config without activating it.
# Usage: just dry-build [hostname]
dry-build host='x1carbon':
sudo nixos-rebuild dry-build --flake .#{{host}}
# Apply a config without switching (for servers / remote hosts).
# Usage: just test [hostname]
test host='x1carbon':
sudo nixos-rebuild test --flake .#{{host}}
# Relaunch QuickShell on the current Hyprland session (picks up a rebuilt
# shell.qml without a full deploy).
restart-qs:
#!/usr/bin/env bash
set -euo pipefail
if ! pgrep -f "[H]yprland" >/dev/null 2>&1; then
echo "not in a Hyprland session; nothing to restart" >&2
exit 1
fi
# comm name is ".quickshell-wra" (kernel-truncated from .quickshell-wrapped);
# -x avoids matching this recipe's own argv.
pkill -x .quickshell-wra || true
sleep 1
QS=quic"kshell"
command "$QS" >/dev/null 2>&1 &
disown || true
echo "quickshell relaunched"