From e7a243b7b9b57d56a8934ee9cf1c9416c7e7b10b Mon Sep 17 00:00:00 2001 From: TNE Date: Tue, 10 Dec 2024 09:23:29 +0100 Subject: [PATCH] fix(garuda-build): Continue cleanup effort --- README.md | 1 - docs/src/SUMMARY.md | 1 - docs/src/general.md | 2 -- docs/src/hosts/garuda-build.md | 26 ------------------------- flake.nix | 9 ++++++++- host_vars/garuda-build/garuda-build.yml | 5 ----- hosts | 1 - nixos/hosts/chaotic-v4.nix | 1 - playbooks/garbage_collect.yml | 2 +- playbooks/system_update.yml | 2 +- 10 files changed, 10 insertions(+), 40 deletions(-) delete mode 100644 docs/src/hosts/garuda-build.md delete mode 100644 host_vars/garuda-build/garuda-build.yml diff --git a/README.md b/README.md index 311ed9ea..68144245 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,6 @@ ## Quick links - [Common maintenance tasks](https://docs.garudalinux.net/common) -- [Host: garuda-build](./hosts/garuda-build.md) - [Host: garuda-mail](https://docs.garudalinux.net/hosts/garuda-mail) - [Host: immortalis](https://docs.garudalinux.net/hosts/immortalis) diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 73f76d94..0a0c7554 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -24,7 +24,6 @@ - [mongodb](./nixos-containers/mongodb.md) - [postgres](./nixos-containers/postgres.md) - [web-front](./nixos-containers/web-front.md) -- [garuda-build](./hosts/garuda-build.md) - [garuda-mail](./hosts/garuda-mail.md) # Repository infrastructure diff --git a/docs/src/general.md b/docs/src/general.md index 5fc557da..f3a7c4ee 100644 --- a/docs/src/general.md +++ b/docs/src/general.md @@ -17,7 +17,6 @@ A general overview of the folder structure can be found below: │ └── fonts ├── home-manager ├── host_vars -│ ├── garuda-build │ ├── garuda-mail │ └── immortalis ├── nixos @@ -26,7 +25,6 @@ A general overview of the folder structure can be found below: │ │ ├── docker │ │ │ └── configs │ │ ├── docker-proxied -│ │ ├── garuda-build │ │ ├── garuda-mail │ │ ├── github-runner │ │ └── immortalis diff --git a/docs/src/hosts/garuda-build.md b/docs/src/hosts/garuda-build.md deleted file mode 100644 index 46c9584f..00000000 --- a/docs/src/hosts/garuda-build.md +++ /dev/null @@ -1,26 +0,0 @@ -## garuda-build (Legacy Fosshost VPS) - -### General - -This server is a legacy, still up Fosshost VPS. Fosshost itself ceased to be quite a while ago, -but this server is still up for some reason. -Since we can't be sure how long it will stay up, we don't want to put anything important on it. -Therefore, its sole purpose is running a disposable build environment for the Chaotic-AUR infra 4.0. - -### Host-specific tasks - -- Restarting the Docker stack: - - `sudo systemctl restart docker-compose-chaotic-v4-builder-root` - - alternatively: `sudo chaotic-restart` - -### Nix expression - -```nix -{{#include ../../../nixos/hosts/garuda-build.nix}} -``` - -### Docker containers - -```nix -{{#include ../../../nixos/hosts/garuda-build/docker-compose.nix}} -``` diff --git a/flake.nix b/flake.nix index d5a8fbc9..3155c012 100644 --- a/flake.nix +++ b/flake.nix @@ -208,13 +208,20 @@ ansible-playbook playbooks/system_update.yml ''; } + { + name = "restart"; + help = "Restarts all physical servers"; + command = '' + ansible-playbook playbooks/reboot.yml + ''; + } { name = "update-forum"; help = "Updates the Discourse container of our forum"; category = "infra-nix"; command = '' # We are assuming the NixOS user is named the same as the one using it - ssh -p224 ${immortalis} "cd /var/disourse; sudo ./launcher rebuild app" + ssh -p224 ${immortalis} "cd /var/discourse; sudo ./launcher rebuild app" ''; } { diff --git a/host_vars/garuda-build/garuda-build.yml b/host_vars/garuda-build/garuda-build.yml deleted file mode 100644 index cc1bc3ca..00000000 --- a/host_vars/garuda-build/garuda-build.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# Base values -actual_hostname: garuda-build -ansible_host: 216.158.66.108 -ansible_port: 1022 diff --git a/hosts b/hosts index 2aa94111..270a8b31 100644 --- a/hosts +++ b/hosts @@ -5,5 +5,4 @@ sftp_enabled = true [nix] immortalis -garuda-build garuda-mail \ No newline at end of file diff --git a/nixos/hosts/chaotic-v4.nix b/nixos/hosts/chaotic-v4.nix index 7fbc2ffa..d01ab98b 100644 --- a/nixos/hosts/chaotic-v4.nix +++ b/nixos/hosts/chaotic-v4.nix @@ -42,7 +42,6 @@ openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN47/usTQsbmcAuG8CbEkurMDzQJxs+Tf8njI/4iTpKu" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN7W5KtNH5nsjIHBN1zBwEc0BZMhg6HfFurMIJoWf39p" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDD2ulefvEwwft9gXj2oUgRl0zWKjG2wkg4xHP1F2p8I" # garuda-build "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICwGMzxuAXAHc+DHbOlgRo/FShbF/QXrlJzhl2k/WBHB" # u726578@sms.cluster.infra.ufscar.br "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDHELhrMFNvxgAYMdzwerszypuvQc3uCFjkR6xCbcQnrcCrueJqTQ4y8WzddwxhRzKbSTQVhPdB5l95IYk7eOtmBmaMp4LAV2osMWDI/x3NyoY5s7YgpW815qNX9Io7VnrFUr0LK7hJ+Uw87nyxGp3zGddPVMUK7PIdJf2GxTxKPryycdLa9QWijfm3YBdN10yBMp6KrfPEnhtmNPMrc3wuBG4+xBoJxNOy0DJdIf2PRwU2CddP0zdDWwlMbGeHGcaJmlAx0u9e1jL8KWB/oyGT1D9q4l+fU8E9nZG+kAFMO1yG25je9bJnYNPMV1gdRT47G3J/B982XYO4G4AiOER0v0M0MN0qWTvIVBG6Vnly81ME91Qao34Lw2QOhZMVFwWz01u8KLLQy/Z2rX7jKyqeUyGXgs5NPmkeJ1vzpSRLXY+5GX5yva8A041Nft7sfKYPFjMsDaxAKVPz7LkKX1dYdiC4c3a/RcCzLKY+Uabjr0QAK4MKwmMW+SNF0QHr9mk= root@Chaotic" # CatBuilder ]; diff --git a/playbooks/garbage_collect.yml b/playbooks/garbage_collect.yml index 69e199c3..ec80c143 100644 --- a/playbooks/garbage_collect.yml +++ b/playbooks/garbage_collect.yml @@ -5,5 +5,5 @@ gather_facts: false tasks: - name: Collect garbage - ansible.builtin.shell: systemctl start --wait nix-clean-result.service && nix-collect-garbage -d + ansible.builtin.shell: nh clean all changed_when: false diff --git a/playbooks/system_update.yml b/playbooks/system_update.yml index fcfbce37..2fa4aa55 100644 --- a/playbooks/system_update.yml +++ b/playbooks/system_update.yml @@ -5,7 +5,7 @@ become: true tasks: - name: Update nix flake and push to cachix - ansible.builtin.shell: set -o pipefail; + ansible.builtin.shell: set -euo pipefail; nix flake update && export CACHIX_AUTH_TOKEN="$(<"/var/garuda/secrets/cachix")" && nix flake archive --json | jq -r '.inputs|to_entries[].value.path' | cachix push garuda-linux && nix-store -qR --include-outputs $(nix-store -qd $(nix build --cores 24 '.#nixosConfigurations."cachix".config.cachix' --json | jq -r '.[].outputs | to_entries[].value')) | grep -v '\.drv$' | cachix push garuda-linux