diff --git a/.github/workflows/nix-flake-check.yaml b/.github/workflows/nix-flake-check.yaml new file mode 100644 index 000000000..e20109947 --- /dev/null +++ b/.github/workflows/nix-flake-check.yaml @@ -0,0 +1,46 @@ +name: "Check the Nix Flake using `nix flake check`" + +env: + ALLOWED_URIS: "https://github.com https://api.github.com" + TRUSTED_PUBLIC_KEYS: "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" + SUBSTITUTERS: "https://cache.nixos.org/ https://cache.iog.io" + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +on: + pull_request: + push: + branches: + - main + +jobs: + nix-flake-check: + name: "Run nix flake check on ${{ matrix.os }}" + strategy: + fail-fast: false + matrix: + os: [macos-14, macos-15-intel, ubuntu-22.04] + runs-on: ${{ matrix.os }} + steps: + - name: 📥 Checkout repository + uses: actions/checkout@v4 + - name: Free Disk Space (Ubuntu) + if: matrix.os == 'ubuntu-22.04' + uses: jlumbroso/free-disk-space@main + with: + tool-cache: true + - name: 🛠️ Install Nix + uses: cachix/install-nix-action@v21 + with: + nix_path: nixpkgs=channel:nixos-unstable + install_url: https://releases.nixos.org/nix/nix-2.18.8/install + extra_nix_config: | + allowed-uris = ${{ env.ALLOWED_URIS }} + trusted-public-keys = ${{ env.TRUSTED_PUBLIC_KEYS }} + substituters = ${{ env.SUBSTITUTERS }} + experimental-features = nix-command flakes + accept-flake-config = true + - name: nix-flake-check + run: | + nix show-config + nix --show-trace -L flake check diff --git a/flake.nix b/flake.nix index 2405d5d49..dd2163762 100644 --- a/flake.nix +++ b/flake.nix @@ -56,14 +56,15 @@ "aarch64-darwin" ]; + # TODO(bladyjoker): Enable when Hydra is back to stable flake.hydraJobs = import ./nix/hydra.nix { flake = self; inherit lib; systems = [ "x86_64-linux" - "x86_64-darwin" - "aarch64-linux" - "aarch64-darwin" + # "x86_64-darwin" + # "aarch64-linux" + # "aarch64-darwin" ]; };