From 86b5c2422ea2327a5091a91f178a9eadb945261c Mon Sep 17 00:00:00 2001 From: randogoth Date: Fri, 28 Aug 2026 11:23:26 +0300 Subject: [PATCH] just: parameterize update recipe (system/home/both) `just update system` re-locks + rebuilds the NixOS system flake, `just update home` re-locks + switches the Home Manager flake, and `just update` with no arg does both (system first). Previously update only touched the system flake, leaving the Home Manager side stale. Co-Authored-By: Claude Opus 4.8 --- modules/system/justfile.nix | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/modules/system/justfile.nix b/modules/system/justfile.nix index 29036e9..506aad7 100644 --- a/modules/system/justfile.nix +++ b/modules/system/justfile.nix @@ -26,9 +26,29 @@ let nix-collect-garbage -d [no-cd] - update: - sudo nix flake update --flake "''${NIXOS_FLAKE:-/etc/nixos}" - just rebuild + update target="": + #!/usr/bin/env bash + set -euo pipefail + + update_system() { + sudo nix flake update --flake "''${NIXOS_FLAKE:-/etc/nixos}" + just rebuild + } + + update_home() { + nix flake update --flake "''${XDG_CONFIG_HOME:-$HOME/.config}/home-manager" + just switch + } + + case "{{target}}" in + system) update_system ;; + home) update_home ;; + "") update_system; update_home ;; + *) + echo "usage: just update [system|home] (empty = both)" >&2 + exit 1 + ;; + esac [no-cd] init-home: