name: nix desktop

on:
  push:
    branches: [dev]
    paths:
      - "flake.nix"
      - "flake.lock"
      - "nix/**"
      - "packages/app/**"
      - "packages/desktop/**"
      - ".github/workflows/nix-desktop.yml"
  pull_request:
    paths:
      - "flake.nix"
      - "flake.lock"
      - "nix/**"
      - "packages/app/**"
      - "packages/desktop/**"
      - ".github/workflows/nix-desktop.yml"
  workflow_dispatch:

jobs:
  build-desktop:
    strategy:
      fail-fast: false
      matrix:
        os:
          - depot-ubuntu-24.04-8
          - depot-ubuntu-24.04-arm-8
          - depot-macos-15
    runs-on: ${{ matrix.os }}
    timeout-minutes: 60
    steps:
      - name: Checkout repository
        uses: actions/checkout@v6

      - name: Setup Nix
        uses: nixbuild/nix-quick-install-action@v34

      - name: Build desktop via flake
        run: |
          set -euo pipefail
          nix --version
          nix build .#desktop -L
