From 66bc547abe8ddd685139f0f9113592144c5317d5 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Wed, 11 Feb 2026 22:58:28 -0700 Subject: [PATCH] Try these now --- .gitea/workflows/deploy.yml | 23 ++++++++++------------- flake.nix | 14 +------------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 593a706..4d7b164 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -1,4 +1,9 @@ -name: Deploy Hashel +# Required Gitea Actions secrets: +# SSH_PRIVATE_KEY - Private key for SSH authentication +# DEPLOY_HOST - Target server IP address (e.g. 144.217.160.198) +# DEPLOY_USER - SSH user on the target server (e.g. root) + +name: Deploy Haschel on: push: @@ -9,16 +14,6 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Nix - uses: cachix/install-nix-action@v31 - with: - extra_nix_config: | - experimental-features = nix-command flakes - sandbox = false - - name: Configure SSH run: | mkdir -p ~/.ssh @@ -27,12 +22,14 @@ jobs: cat >> ~/.ssh/config << EOF Host haschel HostName ${{ secrets.DEPLOY_HOST }} + User ${{ secrets.DEPLOY_USER }} StrictHostKeyChecking no UserKnownHostsFile /dev/null IdentityFile ~/.ssh/id_ed25519 EOF chmod 600 ~/.ssh/config - - name: Deploy with deploy-rs + - name: Deploy run: | - nix run github:serokell/deploy-rs -- .#haschel --skip-checks --remote-build + REPO_URL="${{ github.server_url }}/${{ github.repository }}.git" + ssh haschel "rm -rf /tmp/nixos-config && git clone $REPO_URL /tmp/nixos-config && nixos-rebuild switch --flake /tmp/nixos-config#haschel && rm -rf /tmp/nixos-config" diff --git a/flake.nix b/flake.nix index 5c335c0..c17b5c8 100644 --- a/flake.nix +++ b/flake.nix @@ -3,10 +3,9 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; - deploy-rs.url = "github:serokell/deploy-rs"; }; - outputs = { self, nixpkgs, deploy-rs, ... }@inputs: + outputs = { self, nixpkgs, ... }@inputs: let settings = import ./settings.nix; system = "x86_64-linux"; @@ -18,16 +17,5 @@ ./configuration.nix ]; }; - - deploy.nodes."${settings.hostname}" = { - hostname = "haschel"; - sshUser = "root"; - profiles.system = { - user = "root"; - path = deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations."${settings.hostname}"; - }; - }; - - checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; }; }