feat(cli): nomarchy-pull / nomarchy-rebuild / nomarchy-home
Some checks failed
Check / eval (push) Has been cancelled
Some checks failed
Check / eval (push) Has been cancelled
Split lifecycle into three clear commands (user pick): nomarchy-pull git pull (if checkout) + flake.lock update nomarchy-rebuild system switch on current lock (snap + nvd) nomarchy-home Home Manager switch Full upgrade: pull && rebuild && home. Legacy sys-update / sys-rebuild / home-update remain as wrappers. nixos-rebuild-snap uses NOMARCHY_PATH. V0: flake check --no-build green.
This commit is contained in:
@@ -223,8 +223,8 @@ in
|
||||
compares the flake's locked inputs (nixpkgs, the Nomarchy input, …)
|
||||
against upstream and — when Flatpak is enabled — counts Flatpak
|
||||
updates, surfacing a Waybar indicator + a notification when something
|
||||
is available. It never changes anything; you still run sys-update /
|
||||
home-update / flatpak update yourself'' // { default = config.nomarchy.settings.updates.enable or false; };
|
||||
is available. It never changes anything; you still run nomarchy-pull /
|
||||
nomarchy-rebuild / nomarchy-home / flatpak update yourself'' // { default = config.nomarchy.settings.updates.enable or false; };
|
||||
|
||||
interval = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
|
||||
@@ -798,7 +798,7 @@ ${themeRows}
|
||||
fi
|
||||
fi
|
||||
nomarchy-theme-sync --quiet set settings.fingerprint.pam "$new" --no-switch
|
||||
notify-send "Fingerprint" "Use for login: $new — applies on next sys-rebuild."
|
||||
notify-send "Fingerprint" "Use for login: $new — applies on next nomarchy-rebuild."
|
||||
;;
|
||||
esac ;;
|
||||
|
||||
@@ -843,7 +843,7 @@ ${themeRows}
|
||||
printf 'Enter to close.'; read -r _" ;;
|
||||
*Snapshots*) exec "$0" snapshot ;;
|
||||
*"older generation"*)
|
||||
notify-send "System rollback" "Reboot and pick an older NixOS generation in the boot menu (the last 10 are kept). Make it stick: revert the change in ~/.nomarchy, then sys-rebuild. Details: docs/RECOVERY.md §3." ;;
|
||||
notify-send "System rollback" "Reboot and pick an older NixOS generation in the boot menu (the last 10 are kept). Make it stick: revert the change in ~/.nomarchy, then nomarchy-rebuild. Details: docs/RECOVERY.md §3." ;;
|
||||
esac ;;
|
||||
|
||||
tools)
|
||||
|
||||
@@ -69,11 +69,11 @@ in
|
||||
gpl = "git pull";
|
||||
gf = "git fetch --all --prune";
|
||||
|
||||
# Nix — the flake/store verbs (system/home rebuilds already have the
|
||||
# sys-update / home-update commands, so they're not re-aliased here).
|
||||
# Nix — store/flake verbs. Lifecycle is nomarchy-pull /
|
||||
# nomarchy-rebuild / nomarchy-home (full names on PATH, not aliases).
|
||||
ns = "nix shell"; # ns nixpkgs#ripgrep
|
||||
nr = "nix run"; # nr nixpkgs#cowsay
|
||||
nfu = "nix flake update";
|
||||
nfu = "nix flake update"; # prefer nomarchy-pull day-to-day
|
||||
nfc = "nix flake check";
|
||||
nsearch = "nix search nixpkgs";
|
||||
ngc = "nix-collect-garbage -d"; # user generations; sudo for system roots
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Update awareness (opt-in, nomarchy.updates.enable) — a passive background
|
||||
# check that surfaces a Waybar indicator + a notification when updates are
|
||||
# available, without ever changing anything (you still run sys-update /
|
||||
# home-update / flatpak update). It counts:
|
||||
# available, without ever changing anything (you still run nomarchy-pull /
|
||||
# nomarchy-rebuild / nomarchy-home / flatpak update). It counts:
|
||||
# • flake inputs whose locked rev is behind upstream (nixpkgs, the Nomarchy
|
||||
# input, home-manager …) — via `git ls-remote` on each branch-tracking
|
||||
# github/git input in flake.lock; offline → skipped, never a false alarm.
|
||||
@@ -83,7 +83,7 @@ let
|
||||
msg="$nix flake input(s)"
|
||||
[ "$fp" -gt 0 ] && msg="$msg · $fp Flatpak(s)"
|
||||
${pkgs.libnotify}/bin/notify-send -a Nomarchy "Updates available" \
|
||||
"$msg — click the bar icon, or run sys-update."
|
||||
"$msg — click the bar icon, or: nomarchy-pull && nomarchy-rebuild && nomarchy-home"
|
||||
fi
|
||||
refresh_bar ;;
|
||||
status)
|
||||
@@ -91,7 +91,7 @@ let
|
||||
[ "$total" -gt 0 ] 2>/dev/null || exit 0 # up to date / unchecked → hide
|
||||
nix=$("$JQ" -r '.nix // 0' "$state"); fp=$("$JQ" -r '.flatpak // 0' "$state")
|
||||
tip="Updates available"
|
||||
[ "$nix" -gt 0 ] && tip="$tip\n• $nix flake input(s) — sys-update"
|
||||
[ "$nix" -gt 0 ] && tip="$tip\n• $nix flake input(s) — nomarchy-pull && nomarchy-rebuild && nomarchy-home"
|
||||
[ "$fp" -gt 0 ] && tip="$tip\n• $fp Flatpak(s) — flatpak update"
|
||||
printf '{"text":" %d","tooltip":"%s","class":"available"}\n' "$total" "$tip" ;;
|
||||
upgrade)
|
||||
@@ -99,9 +99,13 @@ let
|
||||
nix=$("$JQ" -r '.nix // 0' "$state" 2>/dev/null || echo 0)
|
||||
fp=$("$JQ" -r '.flatpak // 0' "$state" 2>/dev/null || echo 0)
|
||||
echo "Pending: $nix flake input(s), $fp Flatpak(s)."
|
||||
if [ "$nix" -gt 0 ] && command -v sys-update >/dev/null 2>&1; then
|
||||
read -rp "Run sys-update (flake update + system rebuild)? [y/N] " a
|
||||
[ "$a" = y ] && sys-update
|
||||
if [ "$nix" -gt 0 ] && command -v nomarchy-pull >/dev/null 2>&1; then
|
||||
read -rp "Run nomarchy-pull && nomarchy-rebuild && nomarchy-home? [y/N] " a
|
||||
if [ "$a" = y ]; then
|
||||
nomarchy-pull
|
||||
nomarchy-rebuild
|
||||
command -v nomarchy-home >/dev/null 2>&1 && nomarchy-home
|
||||
fi
|
||||
fi
|
||||
if [ "$fp" -gt 0 ] && command -v flatpak >/dev/null 2>&1; then
|
||||
read -rp "Run flatpak update? [y/N] " a
|
||||
|
||||
Reference in New Issue
Block a user