Files
nixos-haus/justfile
2025-10-02 14:18:42 +03:00

47 lines
1.2 KiB
Makefile

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#{{host}}
git push
update: host: _check-host
nix flake update
git add .
git commit -m "nix flake update"
sudo nixos-rebuild switch --upgrade --flake ~/haus#{{host}}
git push
update-and-reboot: host: _check-host
nix flake update
git add .
git commit -m "nix flake update"
sudo nixos-rebuild boot --upgrade --flake ~/haus#{{host}}
git push
update-config-and-reboot: host: _check-host
alejandra .
nix flake update
git add .
git commit
sudo nixos-rebuild boot --upgrade --flake ~/haus#{{host}}
git push
upgrade: host: _check-host
sudo nixos-rebuild switch --upgrade --flake ~/haus#{{host}}
clean:
sudo nix-env --delete-generations old
sudo nix-collect-garbage --delete-older-than 30d
sudo nix store optimise
sudo rm -rf /nix/var/nix/downloads/*
sudo journalctl --vacuum-time=30d