From 74a739b4e61cf066c5d5ab72a24d41a770ad80cc Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 18 Jul 2026 20:30:35 +0700 Subject: [PATCH] activation fix --- .forgejo/workflows/activate.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.forgejo/workflows/activate.yml b/.forgejo/workflows/activate.yml index fab8702..29bfb2d 100644 --- a/.forgejo/workflows/activate.yml +++ b/.forgejo/workflows/activate.yml @@ -19,14 +19,24 @@ jobs: echo "$SSH_KEY" > ./ssh/deploy_key chmod 600 ./ssh/deploy_key - - name: Rebuild and switch + - name: Build and set boot configuration run: | ssh -i ./ssh/deploy_key \ -o PasswordAuthentication=no \ -o StrictHostKeyChecking=no \ -o UserKnownHostsFile=/dev/null \ root@localhost \ - "bash -lc 'nixos-rebuild switch --refresh --flake git+http://localhost:5080/satr14/nix-flake#homelab -L'" + "bash -lc 'nixos-rebuild boot --refresh --flake git+http://localhost:5080/satr14/nix-flake#homelab -L'" + + - name: Activate configuration + continue-on-error: true + run: | + ssh -i ./ssh/deploy_key \ + -o PasswordAuthentication=no \ + -o StrictHostKeyChecking=no \ + -o UserKnownHostsFile=/dev/null \ + root@localhost \ + "bash -lc 'setsid nohup /nix/var/nix/profiles/system/bin/switch-to-configuration switch > /var/log/nixos-switch.log 2>&1 < /dev/null & disown'" - name: Notify on failure if: failure() @@ -38,15 +48,6 @@ jobs: -H "Actions: view, Action Runs, https://git.satr14.my.id/${{ github.repository }}/actions?workflow=activate.yml; view, View Commit, https://git.satr14.my.id/${{ github.repository }}/commit/${{ github.sha }}" \ -d "${{ github.event.head_commit.message }}" - # - name: Notify on success - # if: success() - # run: | - # curl -s -X POST https://notify.proxy.satr14.my.id/git-flake-updates \ - # -H "Title: NixOS Homelab Rebuild Succeeded" \ - # -H "Tags: white_check_mark" \ - # -H "Actions: view, View Commit, https://git.satr14.my.id/${{ github.repository }}/commit/${{ github.sha }}" \ - # -d "${{ github.event.head_commit.message }}" - - name: Clean Up if: always() run: rm -f ./ssh/deploy_key \ No newline at end of file