diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 2b216e8..c9ed6e6 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -22,6 +22,5 @@ jobs: - name: Build cryodev-main run: nix build .#nixosConfigurations.cryodev-main.config.system.build.toplevel --impure - # Pi build disabled: QEMU emulation crashes on Node.js packages - # - name: Build cryodev-pi - # run: nix build .#nixosConfigurations.cryodev-pi.config.system.build.toplevel --impure + - name: Build cryodev-pi + run: nix build .#nixosConfigurations.cryodev-pi.config.system.build.toplevel --impure --extra-platforms aarch64-linux diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index 7849a1d..9ff2d49 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -25,19 +25,82 @@ jobs: - name: Build cryodev-main run: nix build .#nixosConfigurations.cryodev-main.config.system.build.toplevel --impure - # Pi build disabled: QEMU emulation crashes on Node.js packages - # - name: Build cryodev-pi - # run: nix build .#nixosConfigurations.cryodev-pi.config.system.build.toplevel --impure + - name: Build cryodev-pi + run: nix build .#nixosConfigurations.cryodev-pi.config.system.build.toplevel --impure --extra-platforms aarch64-linux - # Pi builds require native aarch64 or reliable QEMU emulation. - # Currently disabled due to QEMU crashes with Node.js packages. - # Build Pi images locally with: - # nix build .#nixosConfigurations.cryodev-pi.config.system.build.sdImage --extra-platforms aarch64-linux - # - # build-pi-images: - # needs: build-hosts - # ... - # - # create-release: - # needs: build-pi-images - # ... + build-pi-images: + needs: build-hosts + runs-on: host + strategy: + matrix: + host: [cryodev-pi] + fail-fast: false + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build SD image for ${{ matrix.host }} + run: | + echo "Building SD image for: ${{ matrix.host }}" + nix build .#nixosConfigurations.${{ matrix.host }}.config.system.build.sdImage \ + --extra-platforms aarch64-linux \ + --out-link result-${{ matrix.host }} + + IMAGE_PATH=$(find result-${{ matrix.host }} -name "*.img.zst" -type f | head -1) + if [ -z "$IMAGE_PATH" ]; then + echo "Error: No image found!" + exit 1 + fi + + cp "$IMAGE_PATH" ./${{ matrix.host }}-sd-image.img.zst + sha256sum ${{ matrix.host }}-sd-image.img.zst > ${{ matrix.host }}-sd-image.img.zst.sha256 + + echo "Image size:" + ls -lh ${{ matrix.host }}-sd-image.img.zst + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.host }}-sd-image + path: | + ${{ matrix.host }}-sd-image.img.zst + ${{ matrix.host }}-sd-image.img.zst.sha256 + + create-release: + needs: build-pi-images + runs-on: host + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download all artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts/ + + - name: Create Release and Upload + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + VERSION="v$(date +%Y-%m-%d)-$(git rev-parse --short HEAD)" + + curl -s -X POST \ + -H "Authorization: token ${GITHUB_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "{\"tag_name\": \"${VERSION}\", \"name\": \"Pi Images ${VERSION}\", \"body\": \"Raspberry Pi SD card images. See docs for usage.\", \"draft\": false, \"prerelease\": false}" \ + "https://git.cryodev.xyz/api/v1/repos/${GITHUB_REPOSITORY}/releases" \ + -o release.json + + RELEASE_ID=$(jq -r '.id' release.json) + echo "Release ID: $RELEASE_ID" + + for file in $(find artifacts -type f); do + echo "Uploading: $(basename $file)" + curl -s -X POST \ + -H "Authorization: token ${GITHUB_TOKEN}" \ + -H "Content-Type: application/octet-stream" \ + --data-binary @"$file" \ + "https://git.cryodev.xyz/api/v1/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=$(basename $file)" + done + + echo "Done: https://git.cryodev.xyz/${GITHUB_REPOSITORY}/releases/tag/${VERSION}" diff --git a/modules/nixos/nixvim/plugins/default.nix b/modules/nixos/nixvim/plugins/default.nix index 1941f43..5f3891a 100644 --- a/modules/nixos/nixvim/plugins/default.nix +++ b/modules/nixos/nixvim/plugins/default.nix @@ -11,8 +11,6 @@ ]; config.programs.nixvim.plugins = { - markdown-preview.enable = lib.mkDefault true; - # warning: Nixvim: `plugins.web-devicons` was enabled automatically because the following plugins are enabled. This behaviour is deprecated. Please explicitly define `plugins.web-devicons.enable` web-devicons.enable = true; }; }