From 21a757232d8bbb0c358abb0d9fde75710a3ef18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Sat, 28 Mar 2026 00:49:57 +0100 Subject: [PATCH] feat: add provision and deploy just recipes --- justfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/justfile b/justfile index dc533a1..1ccc3fd 100644 --- a/justfile +++ b/justfile @@ -41,6 +41,14 @@ ephvm *ARGS: ephvm-ssh port="2222": ssh -p {{port}} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null matej@localhost +# provision a host with nixos-anywhere +provision host ip: + nix run github:nix-community/nixos-anywhere -- --flake .#{{host}} --generate-hardware-config nixos-generate-config ./hosts/{{host}}/hardware-configuration.nix root@{{ip}} + +# deploy config to a remote host +deploy host remote=host: + nixos-rebuild switch --flake .#{{host}} --target-host {{remote}} --sudo --ask-sudo-password + # garbage collect old generations clean: sudo nix-collect-garbage $(nix eval --raw -f ./nix.nix nix.gc.options)