diff --git a/update.nu b/update.nu new file mode 100755 index 0000000..39241f0 --- /dev/null +++ b/update.nu @@ -0,0 +1,46 @@ +#!/usr/bin/env nu + +def main [] { + ./update.nu --help +} + +def "main preset partial-update" [] { + main device flake + main device qepc + main device qelaptop +} + +def "main preset full-update" [] { + main device flake + main device qepc + main device qelaptop + main device homelab-system + main device homelab-services + main device implovps-system +} + +def "main device flake" [] { + nix flake update --flake ~/.config/dotfiles/ + echo "flake updated. To commit the changes you still need to commit the lock file manually" +} + +def "main device qepc" [] { + nh os switch --update +} + +def "main device qelaptop" [] { + echo "not implemented" +} + +def "main device homelab-system" [] { + ssh implohq 'sudo apt update && sudo apt upgrade -y' +} + +def "main device homelab-services" [] { + ssh -t implohq 'cd .services/homelab && docker compose pull && docker compose up --force-recreate -d' +} + +def "main device implovps-system" [] { + ssh -t implo-vps 'sudo apt update && sudo apt upgrade -y' +} + diff --git a/updater.nu b/updater.nu deleted file mode 100755 index 03e7bc9..0000000 --- a/updater.nu +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env nu - -def main [] { - update_all - -} - -def update_all [] { - main flake - main qepc - main qelaptop - main homelab-system - main homelab-services - main implovps-system -} - -def "main flake" [] { - nix flake update --flake ~/.config/dotfiles/ - echo "flake updated. To commit the changes you still need to commit the lock file manually" -} - -def "main qepc" [] { - nh os switch --update -} - -def "main qelaptop" [] { - echo "not implemented" -} - -def "main homelab-system" [] { - ssh implohq 'sudo apt update && sudo apt upgrade -y' -} - -def "main homelab-services" [] { - ssh -t implohq 'cd .services/homelab && docker compose pull && docker compose up --force-recreate -d' -} - -def "main implovps-system" [] { - ssh -t implo-vps 'sudo apt update && sudo apt upgrade -y' -} -