From 1080b3a8ccd815f1e19a35e39f5dbd600de0047e Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 15 Sep 2025 15:36:09 +0300 Subject: [PATCH 01/14] add tailscale --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 471c361..800f57f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,13 @@ jobs: - name: Install nix uses: cachix/install-nix-action@v16 + - name: Login to tailscale + uses: tailscale/github-action@v3.2.3 + with: + oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} + oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} + tags: tag:ci + hostname: github-actions # TODO: add a binary cache # - uses: cachix/cachix-action@v10 From 04d828f9d8782fbf4b699a9fd48bb8be34a48c72 Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 15 Sep 2025 15:37:39 +0300 Subject: [PATCH 02/14] no tag --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 800f57f..a5383be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,6 @@ jobs: with: oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} - tags: tag:ci hostname: github-actions # TODO: add a binary cache From f83a04eba7688ea425dadbe558980f7c9369b52b Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 15 Sep 2025 15:51:49 +0300 Subject: [PATCH 03/14] wtf --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5383be..e264ea5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,7 @@ jobs: oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} hostname: github-actions + tags: tag:ci # TODO: add a binary cache # - uses: cachix/cachix-action@v10 From 73e5ab059ffd44d19dfa11ac6bc50a2d554c1dc4 Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 15 Sep 2025 16:00:11 +0300 Subject: [PATCH 04/14] formatting --- config/plugins/avante.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config/plugins/avante.nix b/config/plugins/avante.nix index 50f5647..dbe9ec7 100644 --- a/config/plugins/avante.nix +++ b/config/plugins/avante.nix @@ -5,14 +5,14 @@ # provider = "ollama"; # provider = "claude"; providers = { - # claude = { - # endpoint = "https://api.anthropic.com"; - # extra_request_body = { - # max_tokens = 4096; - # temperature = 0; - # }; - # model = "claude-3-5-sonnet-20240620"; - # }; + # claude = { + # endpoint = "https://api.anthropic.com"; + # extra_request_body = { + # max_tokens = 4096; + # temperature = 0; + # }; + # model = "claude-3-5-sonnet-20240620"; + # }; ollama = { endpoint = "http://localhost:11434"; model = "qwen2.5-coder:32b"; From 6d14def506c1736b2b480ad626add6d64adfafee Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 15 Sep 2025 16:21:02 +0300 Subject: [PATCH 05/14] add attic --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e264ea5..c5474f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,12 +22,12 @@ jobs: hostname: github-actions tags: tag:ci - # TODO: add a binary cache - # - uses: cachix/cachix-action@v10 - # with: - # name: YOURCACHE - # authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - + - name: Setup Attic cache + uses: ryanccn/attic-action@v0.4.0 + with: + endpoint: http://wallfacer.curl-boga.ts.net:7080 + cache: main + token: ${{ secrets.ATTIC_TOKEN }} - name: Check the flake run: nix flake check --accept-flake-config From 82cad3c0dd64e965a75a58cf88e160155353046e Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 15 Sep 2025 16:26:34 +0300 Subject: [PATCH 06/14] i wonder --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5474f7..c06f0eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: tags: tag:ci - name: Setup Attic cache - uses: ryanccn/attic-action@v0.4.0 + uses: ryanccn/attic-action@v0 with: endpoint: http://wallfacer.curl-boga.ts.net:7080 cache: main From 009dfd4cd5bb7451d4c6cb60d6982874f23af69a Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 15 Sep 2025 16:29:36 +0300 Subject: [PATCH 07/14] was this the problem --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c06f0eb..a0e4da3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v2 - name: Install nix - uses: cachix/install-nix-action@v16 + uses: cachix/install-nix-action@v27 - name: Login to tailscale uses: tailscale/github-action@v3.2.3 @@ -23,7 +23,7 @@ jobs: tags: tag:ci - name: Setup Attic cache - uses: ryanccn/attic-action@v0 + uses: ryanccn/attic-action@v0.3.1 with: endpoint: http://wallfacer.curl-boga.ts.net:7080 cache: main From 05672d4b09989b1c14247e47a9a6b33d85db08d3 Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 15 Sep 2025 16:42:54 +0300 Subject: [PATCH 08/14] will this work? --- .github/workflows/ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0e4da3..6d2d1b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,17 @@ jobs: hostname: github-actions tags: tag:ci + - name: Check if Attic endpoint is reachable + id: check_attic + run: | + if curl --connect-timeout 5 --silent --head http://wallfacer.curl-boga.ts.net:7080 | grep "200 OK"; then + echo "reachable=true" >> $GITHUB_OUTPUT + else + echo "reachable=false" >> $GITHUB_OUTPUT + fi + - name: Setup Attic cache + if: steps.check_attic.outputs.reachable == 'true' uses: ryanccn/attic-action@v0.3.1 with: endpoint: http://wallfacer.curl-boga.ts.net:7080 From 7020149e6daf5914cb22737f9ed27c9e9dac0e3c Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 15 Sep 2025 16:45:34 +0300 Subject: [PATCH 09/14] no concurrency --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d2d1b3..11ae89b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,10 @@ on: push: workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-24.04 From 8d5c8245c218d7c42d87bdb1ba7540fafe0b043a Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 15 Sep 2025 16:52:42 +0300 Subject: [PATCH 10/14] try --- .github/workflows/ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11ae89b..20c251b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,16 @@ concurrency: jobs: build: - runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + system: + - x86_64-linux + - aarch64-linux + - x86_64-darwin + runs-on: ${{ matrix.system == 'x86_64-linux' && 'ubuntu-24.04' + || matrix.system == 'aarch64-linux' && 'ubuntu-24.04-arm' + || matrix.system == 'x86_64-darwin' && 'macos-latest' }} steps: - name: Checkout the repository uses: actions/checkout@v2 @@ -23,7 +32,7 @@ jobs: with: oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} - hostname: github-actions + hostname: github-actions-${{ matrix.system }} tags: tag:ci - name: Check if Attic endpoint is reachable From 5ce23054d9c01e40351b704f3fd7284472d2b46b Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 15 Sep 2025 16:54:21 +0300 Subject: [PATCH 11/14] does this work --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20c251b..77fee36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: with: oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} - hostname: github-actions-${{ matrix.system }} + hostname: github-actions-${{ replace(matrix.system, '_', '-') }} tags: tag:ci - name: Check if Attic endpoint is reachable From 3b19d429ce26ef091114100f0b66b2c4c1f77a1a Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 15 Sep 2025 16:56:41 +0300 Subject: [PATCH 12/14] weird syntax --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77fee36..7a2d2ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: with: oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} - hostname: github-actions-${{ replace(matrix.system, '_', '-') }} + hostname: github-actions-${{ matrix.system//_/- }} tags: tag:ci - name: Check if Attic endpoint is reachable From c813cb28ade02bc6104b6cd3727e28ad8f13ef17 Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 15 Sep 2025 16:59:43 +0300 Subject: [PATCH 13/14] simpler haha --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a2d2ca..6ce7662 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,9 @@ jobs: with: oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} - hostname: github-actions-${{ matrix.system//_/- }} + hostname: ${{ matrix.system == 'x86_64-linux' && 'github-actions-x86-64-linux' + || matrix.system == 'aarch64-linux' && 'github-actions-aarch64-linux' + || matrix.system == 'x86_64-darwin' && 'github-actions-x86-64-darwin' }} tags: tag:ci - name: Check if Attic endpoint is reachable From 05af1a15f1046507459e6c36a2ac66d490887d6a Mon Sep 17 00:00:00 2001 From: osbm Date: Mon, 15 Sep 2025 17:03:56 +0300 Subject: [PATCH 14/14] use custom action --- .github/actions/setup-nix/action.yml | 67 ++++++++++++++++++++++++++++ .github/workflows/ci.yml | 8 ++-- 2 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 .github/actions/setup-nix/action.yml diff --git a/.github/actions/setup-nix/action.yml b/.github/actions/setup-nix/action.yml new file mode 100644 index 0000000..dfd6c22 --- /dev/null +++ b/.github/actions/setup-nix/action.yml @@ -0,0 +1,67 @@ +name: setup-nix + +inputs: + system: + type: string + required: true + sandbox: + type: string + default: "true" + +runs: + using: composite + steps: + - name: reclaim space (linux) + if: runner.os == 'Linux' + uses: wimpysworld/nothing-but-nix@main + with: + hatchet-protocol: rampage + + - name: reclaim space (darwin) + if: runner.os == 'macOS' + shell: bash + run: | + echo "::group::disk space (before)" + sudo df -h + echo "::endgroup::" + + echo "::group::disable mds" + sudo mdutil -i off -a || echo "mdutil failed" + sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist \ + || echo "launchctl unload failed" + echo "::endgroup::" + + echo "Background space expansion started. /nix will grow as space becomes available." + sudo rm -rf \ + /Applications/Xcode_* \ + /Library/Developer/CoreSimulator \ + /Library/Frameworks \ + /Users/runner/.dotnet \ + /Users/runner/.rustup \ + /Users/runner/Library/Android \ + /Users/runner/Library/Caches \ + /Users/runner/Library/Developer/CoreSimulator \ + /Users/runner/hostedtoolcache & + + - name: install nix + uses: cachix/install-nix-action@v31 + with: + # Putting build-dir in /nix is a workaround for https://github.com/wimpysworld/nothing-but-nix/issues/18 + extra_nix_config: | + build-dir = /nix/build + sandbox = ${{ inputs.sandbox }} + system = ${{ inputs.system }} + + - name: create build-dir + shell: bash + run: sudo mkdir -p /nix/build + + - name: post setup-nix + if: runner.os == 'macOS' + uses: srz-zumix/post-run-action@v2 + with: + shell: bash -e {0} + post-run: | + echo "::group::disk space (after)" + sudo df -h + echo "::endgroup::" \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ce7662..3d7fa42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,9 +24,11 @@ jobs: - name: Checkout the repository uses: actions/checkout@v2 - - name: Install nix - uses: cachix/install-nix-action@v27 - + - name: setup nix + uses: ./.github/actions/setup-nix + with: + system: ${{ matrix.system }} + - name: Login to tailscale uses: tailscale/github-action@v3.2.3 with: