From 5164b5cc0abb8f6add7552a36c5f9746e7ccf13a Mon Sep 17 00:00:00 2001 From: kenny Date: Thu, 2 Oct 2025 14:18:42 +0300 Subject: [PATCH] Added host arg in justfile --- justfile | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/justfile b/justfile index ade605b..d8b62e6 100644 --- a/justfile +++ b/justfile @@ -1,35 +1,42 @@ -update-config: +hosts := "puter box" + +_check-host host: + if ! echo "{{hosts}}" | grep -qw "{{host}}"; then \ + echo "Unknown host:{{host}} \n Must be one of: {{hosts}}"; exit 1;\ + fi + +update-config: host: _check-host alejandra . nix flake update git add . git commit - sudo nixos-rebuild switch --upgrade --flake ~/haus#puter + sudo nixos-rebuild switch --upgrade --flake ~/haus#{{host}} git push -update: +update: host: _check-host nix flake update git add . git commit -m "nix flake update" - sudo nixos-rebuild switch --upgrade --flake ~/haus#puter + sudo nixos-rebuild switch --upgrade --flake ~/haus#{{host}} git push -update-and-reboot: +update-and-reboot: host: _check-host nix flake update git add . git commit -m "nix flake update" - sudo nixos-rebuild boot --upgrade --flake ~/haus#puter + sudo nixos-rebuild boot --upgrade --flake ~/haus#{{host}} git push -update-config-and-reboot: +update-config-and-reboot: host: _check-host alejandra . nix flake update git add . git commit - sudo nixos-rebuild boot --upgrade --flake ~/haus#puter + sudo nixos-rebuild boot --upgrade --flake ~/haus#{{host}} git push -upgrade: - sudo nixos-rebuild switch --upgrade --flake ~/haus#puter +upgrade: host: _check-host + sudo nixos-rebuild switch --upgrade --flake ~/haus#{{host}} clean: sudo nix-env --delete-generations old