diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml index 4f512d84b1..83ed8787b3 100644 --- a/.github/workflows/actionlint.yml +++ b/.github/workflows/actionlint.yml @@ -1,6 +1,7 @@ name: Actionlint on: + merge_group: pull_request: jobs: @@ -13,20 +14,16 @@ jobs: # actionlint is not going to install its own shellcheck. # This also makes sure that this pipeline runs using # the same shellcheck as the ones in Nix shells of developers. - - name: Install Nix with good defaults - uses: input-output-hk/install-nix-action@v20 + - uses: cachix/install-nix-action@v30 with: + nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= substituters = https://cache.iog.io/ https://cache.nixos.org/ - nix_path: nixpkgs=channel:nixos-unstable - - uses: cachix/install-nix-action@v18 - with: - nix_path: nixpkgs=channel:nixos-unstable - # Make the Nix environment available to next steps + - uses: rrbutani/use-nix-shell-action@v1 - - name: actionlint + - name: Run Actionlint run: | for file in $(git ls-files ".github/workflows/*.y*ml") do diff --git a/.github/workflows/check-cabal-files.yml b/.github/workflows/check-cabal-files.yml index dc8a7048b9..3cc3532da3 100644 --- a/.github/workflows/check-cabal-files.yml +++ b/.github/workflows/check-cabal-files.yml @@ -9,18 +9,16 @@ jobs: runs-on: ubuntu-latest steps: - - name: Workaround runner image issue - if: runner.os == 'Linux' - # https://github.com/actions/runner-images/issues/7061 - run: sudo chown -R "$USER" /usr/local/.ghcup + - uses: actions/checkout@v4 - - name: Install Haskell - uses: input-output-hk/setup-haskell@v1 - id: setup-haskell - with: - cabal-version: "3.10.1.0" + - uses: cachix/install-nix-action@v30 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= + substituters = https://cache.iog.io/ https://cache.nixos.org/ - - uses: actions/checkout@v3 + - uses: rrbutani/use-nix-shell-action@v1 - - name: Cabal check - run: ./scripts/ci/check-cabal-files.sh + - name: Cabal check + run: ./scripts/ci/check-cabal-files.sh diff --git a/.github/workflows/check-cabal-gild.yml b/.github/workflows/check-cabal-gild.yml index 569aa9e1ea..dee17ac1b4 100644 --- a/.github/workflows/check-cabal-gild.yml +++ b/.github/workflows/check-cabal-gild.yml @@ -7,42 +7,37 @@ on: jobs: check-cabal-gild: runs-on: ubuntu-latest - - env: - CABAL_GILD_VERSION: "1.3.1.2" - steps: - - name: Download cabal-gild - run: | - cabal_gild_path="$(mktemp -d)" - version="${{env.CABAL_GILD_VERSION}}" - curl -sL \ - "https://github.com/tfausak/cabal-gild/releases/download/$version/cabal-gild-$version-linux-x64.tar.gz" \ - | tar -C "$cabal_gild_path" -xz - - echo "PATH=$cabal_gild_path:$PATH" >> "$GITHUB_ENV" - - - uses: actions/checkout@v4 - - - name: Run cabal-gild over all modified files - run: | - rc="0" - echo "cabal-gild version: ${{env.CABAL_GILD_VERSION}}" - for file in $(git ls-files "*.cabal") - do - echo "cabal-gild --mode=check --input=$file" - if ! cabal-gild --mode=check --input="$file" - then - cabal-gild --mode=format --io="$file" - echo "💣 $file is badly formatted. Fix it with:" - echo "cabal-gild --mode=format --io=$file" - echo -e - echo "Diff for $file:" - git diff "$file" - echo -e - rc="1" - fi - done - - exit $rc + - uses: actions/checkout@v4 + + - uses: cachix/install-nix-action@v30 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= + substituters = https://cache.iog.io/ https://cache.nixos.org/ + + - uses: rrbutani/use-nix-shell-action@v1 + + - name: Run cabal-gild over all modified files + run: | + rc="0" + echo "cabal-gild version: $(cabal-gild --version)" + for file in $(git ls-files "*.cabal") + do + echo "cabal-gild --mode=check --input=$file" + if ! cabal-gild --mode=check --input="$file" + then + cabal-gild --mode=format --io="$file" + echo "💣 $file is badly formatted. Fix it with:" + echo "cabal-gild --mode=format --io=$file" + echo -e + echo "Diff for $file:" + git diff "$file" + echo -e + rc="1" + fi + done + + exit $rc diff --git a/.github/workflows/check-formatting.yml b/.github/workflows/check-formatting.yml index 1040c55c2f..61768513e3 100644 --- a/.github/workflows/check-formatting.yml +++ b/.github/workflows/check-formatting.yml @@ -1,4 +1,4 @@ -name: Check Haskell formatting +name: Check Haskell formatting on: merge_group: @@ -22,50 +22,49 @@ jobs: check-formatting: runs-on: ubuntu-latest - env: - FOURMOLU_VERSION: "0.16.2.0" - STYLISH_HASKELL_VERSION: "0.14.6.0" - steps: - - name: Download Fourmolu - run: | - fourmolu_path="$(mktemp -d)" - version="${{env.FOURMOLU_VERSION}}" - curl -sL \ - "https://github.com/fourmolu/fourmolu/releases/download/v$version/fourmolu-$version-linux-x86_64" > "$fourmolu_path/fourmolu" - echo "PATH=$fourmolu_path:$PATH" >> "$GITHUB_ENV" - chmod u+rwx "$fourmolu_path/fourmolu" + - uses: actions/checkout@v4 - - name: Download stylish-haskell - run: | - stylish_haskell_path="$(mktemp -d)" - version="${{ env.STYLISH_HASKELL_VERSION }}" - curl -sL \ - "https://github.com/haskell/stylish-haskell/releases/download/v$version/stylish-haskell-v$version-linux-x86_64.tar.gz" \ - | tar -C "$stylish_haskell_path" -xz - echo "PATH=$stylish_haskell_path/stylish-haskell-v$version-linux-x86_64:$PATH" >> "$GITHUB_ENV" + - uses: cachix/install-nix-action@v30 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= + substituters = https://cache.iog.io/ https://cache.nixos.org/ - - uses: actions/checkout@v3 + - uses: rrbutani/use-nix-shell-action@v1 - - name: Run formatting over all Haskell files (always succeeds) - run: | - git add . - git stash + - name: Run formatting over all Haskell files (always succeeds) + run: | + git add . + git stash - for x in $(git ls-tree --full-tree --name-only -r HEAD); do - "$(git rev-parse --show-toplevel)/scripts/devshell/prettify" "$x" - done + for x in $(git ls-tree --full-tree --name-only -r HEAD); do + if [ "${x##*.}" == "hs" ]; then + if grep -qE '^#' "$x"; then + echo "$x contains CPP. Skipping." + else + "$(git rev-parse --show-toplevel)/scripts/devshell/prettify" "$x" + fi + fi + done - git --no-pager diff + git --no-pager diff - - name: Run formatting over all modified files - run: | - git add . - git stash - git fetch origin ${{ github.base_ref }} --unshallow - for x in $(git diff --name-only --diff-filter=ACMR origin/${{ github.base_ref }}..HEAD); do - "$(git rev-parse --show-toplevel)/scripts/devshell/prettify" "$x" - done + - name: Run formatting over all modified files + run: | + git add . + git stash + git fetch origin ${{ github.base_ref }} --unshallow + for x in $(git diff --name-only --diff-filter=ACMR origin/${{ github.base_ref }}..HEAD); do + if [ "${x##*.}" == "hs" ]; then + if grep -qE '^#' "$x"; then + echo "$x contains CPP. Skipping." + else + "$(git rev-parse --show-toplevel)/scripts/devshell/prettify" "$x" + fi + fi + done - git --no-pager diff --exit-code + git --no-pager diff --exit-code diff --git a/.github/workflows/check-git-dependencies.yml b/.github/workflows/check-git-dependencies.yml index 8639392485..a7caa10a5e 100644 --- a/.github/workflows/check-git-dependencies.yml +++ b/.github/workflows/check-git-dependencies.yml @@ -14,7 +14,7 @@ jobs: steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check git dependencies run: | diff --git a/.github/workflows/check-hlint.yml b/.github/workflows/check-hlint.yml index c8b6a8658c..adf9cea84d 100644 --- a/.github/workflows/check-hlint.yml +++ b/.github/workflows/check-hlint.yml @@ -14,6 +14,6 @@ jobs: steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: haskell-actions/hlint-scan@v1 diff --git a/.github/workflows/check-pr-changelog.yml b/.github/workflows/check-pr-changelog.yml index e59023b5c5..8edcf155b3 100644 --- a/.github/workflows/check-pr-changelog.yml +++ b/.github/workflows/check-pr-changelog.yml @@ -8,12 +8,12 @@ jobs: check-changelog: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 if: ${{ github.event_name != 'merge_group' }} with: - node-version: 16 + node-version: 22 - run: npm install js-yaml@4.1.0 if: ${{ github.event_name != 'merge_group' }} diff --git a/.github/workflows/github-page.yml b/.github/workflows/github-page.yml index 1ea2acd980..6871ac83ab 100644 --- a/.github/workflows/github-page.yml +++ b/.github/workflows/github-page.yml @@ -4,6 +4,7 @@ on: push: branches: - master + workflow_dispatch: jobs: build: @@ -14,54 +15,46 @@ jobs: shell: bash steps: - - name: Install Nix - uses: cachix/install-nix-action@v18 - with: - # Use last stable nixos channel and the same nix as in channel: - install_url: https://releases.nixos.org/nix/nix-2.11.1/install - nix_path: nixpkgs=channel:nixos-22.11 - github_access_token: ${{ secrets.GITHUB_TOKEN }} - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - experimental-features = nix-command flakes - allow-import-from-derivation = true - substituters = https://cache.nixos.org https://cache.iog.io - trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - uses: actions/checkout@v4 - - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v30 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= + substituters = https://cache.iog.io/ https://cache.nixos.org/ - - name: Fetch nix cache and update cabal indices - run: | - nix develop .\#haddockShell --command \ + - uses: rrbutani/use-nix-shell-action@v1 + + - name: Update cabal indices + run: | cabal update - - name: Build whole project - run: | - nix develop .\#haddockShell --command \ + - name: Build whole project + run: | cabal build all - - name: Build documentation - run: | - nix develop .\#haddockShell --command \ + - name: Build documentation + run: | cabal haddock-project --output=./haddocks --internal --foreign-libraries - - name: Compress haddocks - run: | - tar -czf haddocks.tgz -C haddocks . - - - name: Upload haddocks artifact - uses: actions/upload-artifact@v4 - if: ${{ always() }} - continue-on-error: true - with: - name: haddocks - path: ./haddocks.tgz - - - name: Deploy documentation to gh-pages 🚀 - if: github.ref == 'refs/heads/master' - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN || github.token }} - publish_dir: haddocks - cname: cardano-api.cardano.intersectmbo.org - force_orphan: true + - name: Compress haddocks + run: | + tar -czf haddocks.tgz -C haddocks . + + - name: Upload haddocks artifact + uses: actions/upload-artifact@v4 + if: ${{ always() }} + continue-on-error: true + with: + name: haddocks + path: ./haddocks.tgz + + - name: Deploy documentation to gh-pages 🚀 + if: github.ref == 'refs/heads/master' + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN || github.token }} + publish_dir: haddocks + cname: cardano-api.cardano.intersectmbo.org + force_orphan: true diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 1807e65b7e..acdace911b 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: ghc: ["8.10.7", "9.6", "9.10"] - cabal: ["3.12"] + cabal: ["3.14"] sys: - { os: windows-latest, shell: 'C:/msys64/usr/bin/bash.exe -e {0}' } - { os: ubuntu-latest, shell: bash } diff --git a/.github/workflows/hls.yml b/.github/workflows/hls.yml index 729afa8dc7..162716042b 100644 --- a/.github/workflows/hls.yml +++ b/.github/workflows/hls.yml @@ -5,10 +5,10 @@ on: push: branches: - master - + permissions: contents: read - + jobs: test-hls-works: @@ -16,27 +16,28 @@ jobs: # Modify this value to "invalidate" the cache. HLS_CACHE_VERSION: "2024-07-24" - runs-on: ubuntu-latest timeout-minutes: 60 steps: - - name: Check out repo - uses: actions/checkout@v4 - - name: Install Nix with good defaults - uses: input-output-hk/install-nix-action@v20 + - uses: actions/checkout@v4 + + - uses: cachix/install-nix-action@v30 with: + nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= substituters = https://cache.iog.io/ https://cache.nixos.org/ - nix_path: nixpkgs=channel:nixos-unstable - - name: Open nix environment - uses: rrbutani/use-nix-shell-action@v1 + + - uses: rrbutani/use-nix-shell-action@v1 + - name: Update dependencies run: cabal update; cabal freeze + - name: Obtain GHC version run: | echo "VERSION=$(ghc --numeric-version)" >> "$GITHUB_OUTPUT" id: ghc + - name: HLS caching uses: actions/cache@v4 with: @@ -44,10 +45,11 @@ jobs: /home/runner/.cache/hie-bios /home/runner/.cache/ghcide /home/runner/.local/state/cabal - .ghc.environment.x86_64-linux-9.8.2 + .ghc.environment.x86_64-linux-* dist-newstyle key: hls-cache-${{ env.HLS_CACHE_VERSION }}-${{ runner.os }}-${{ steps.ghc.outputs.VERSION }}-${{ hashFiles('**/cabal.project.freeze') }}-${{ hashFiles('**/*.cabal', '**/cabal.project') }} restore-keys: | hls-cache-${{ env.HLS_CACHE_VERSION }}-${{ runner.os }}-${{ steps.ghc.outputs.VERSION }}-${{ hashFiles('**/cabal.project.freeze') }}- + - name: Test HLS works run: haskell-language-server diff --git a/.github/workflows/markdown-links-ci-check.yml b/.github/workflows/markdown-links-ci-check.yml index f8db014fa4..3a8dd7130a 100644 --- a/.github/workflows/markdown-links-ci-check.yml +++ b/.github/workflows/markdown-links-ci-check.yml @@ -8,7 +8,7 @@ jobs: markdown-link-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: gaurav-nelson/github-action-markdown-link-check@v1 with: use-quiet-mode: yes diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 6bdb89c27b..d3499821ca 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -7,6 +7,7 @@ name: Shellcheck # is consistent with the one of developers. on: + merge_group: pull_request: jobs: @@ -14,18 +15,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Nix with good defaults - uses: input-output-hk/install-nix-action@v20 + + - uses: cachix/install-nix-action@v30 with: + nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= substituters = https://cache.iog.io/ https://cache.nixos.org/ - nix_path: nixpkgs=channel:nixos-unstable - - uses: cachix/install-nix-action@v18 - with: - nix_path: nixpkgs=channel:nixos-unstable - # Make the Nix environment available to next steps + - uses: rrbutani/use-nix-shell-action@v1 + - name: Shellcheck run: | for file in $(git ls-files "*.sh") diff --git a/.github/workflows/stale-bot.yml b/.github/workflows/stale-bot.yml index 5fef42c6ec..0133827ca6 100644 --- a/.github/workflows/stale-bot.yml +++ b/.github/workflows/stale-bot.yml @@ -7,7 +7,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v6 + - uses: actions/stale@v9 with: stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.' stale-pr-message: 'This PR is stale because it has been open 45 days with no activity.' diff --git a/flake.lock b/flake.lock index b5b3c3417a..8bd2615d3d 100644 --- a/flake.lock +++ b/flake.lock @@ -202,14 +202,14 @@ "type": "github" } }, - "hackage": { + "hackageNix": { "flake": false, "locked": { - "lastModified": 1736382484, - "narHash": "sha256-z1wBpMV1uqkZKCo4q4aXVwHcinYtwD0LHI5AEDtpnVA=", + "lastModified": 1738110484, + "narHash": "sha256-Cxn2nFTYSgdAsg51iQ/aWfa0sEwUT1LqlfNCOVbfNNU=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "db572909cbd9ea2179284e594e04a0ec6e480ce0", + "rev": "2688306d0e2b6d721040d4e0e7405553cf64cb7e", "type": "github" }, "original": { @@ -227,7 +227,9 @@ "cardano-shell": "cardano-shell", "flake-compat": "flake-compat_2", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", - "hackage": "hackage", + "hackage": [ + "hackageNix" + ], "hls-1.10": "hls-1.10", "hls-2.0": "hls-2.0", "hls-2.2": "hls-2.2", @@ -258,15 +260,16 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1723683036, - "narHash": "sha256-pT74TrE+bCaeXhYLYJrZVocwopwwua4qOwN7waUdUpU=", + "lastModified": 1726275037, + "narHash": "sha256-q0+NlcOGV1eQRN1FjLpt5li6iyPQPeky37hwP5JLqVU=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "88aeace47b5e43cb4df5f96e754179293c06f47c", + "rev": "a93d40302777a9ce268b3bc57caae3f7fdae1ce1", "type": "github" }, "original": { "owner": "input-output-hk", + "ref": "2024.09.15", "repo": "haskell.nix", "type": "github" } @@ -770,6 +773,7 @@ "cardano-mainnet-mirror": "cardano-mainnet-mirror", "flake-compat": "flake-compat", "flake-utils": "flake-utils", + "hackageNix": "hackageNix", "haskellNix": "haskellNix", "iohkNix": "iohkNix", "nixpkgs": [ @@ -815,11 +819,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1723594352, - "narHash": "sha256-cQVhF1M1et3/XNE1sclwH39prxIDMUojTdnW61t3YrM=", + "lastModified": 1726100060, + "narHash": "sha256-nvxogFYvwoUuqTHKyn1vcOuQFKEGGlXiTNzTDHeOImk=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "c077da02c56031a78adc4bf0cf2b182effc895ed", + "rev": "732fcc1460200a3050697a056a0fe9d460d0dbec", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index bea3960c12..cfcf10755a 100644 --- a/flake.nix +++ b/flake.nix @@ -2,20 +2,32 @@ description = "cardano-api"; inputs = { - haskellNix.url = "github:input-output-hk/haskell.nix"; + hackageNix = { + url = "github:input-output-hk/hackage.nix"; + flake = false; + }; + haskellNix = { + url = "github:input-output-hk/haskell.nix?ref=2024.09.15"; + inputs.hackage.follows = "hackageNix"; + }; nixpkgs.follows = "haskellNix/nixpkgs-unstable"; iohkNix.url = "github:input-output-hk/iohk-nix"; flake-utils.url = "github:hamishmack/flake-utils/hkm/nested-hydraJobs"; + # non-flake nix compatibility + flake-compat = { + url = "github:edolstra/flake-compat"; + flake = false; + }; - cardano-mainnet-mirror.url = "github:input-output-hk/cardano-mainnet-mirror"; - cardano-mainnet-mirror.flake = false; - - CHaP.url = "github:intersectmbo/cardano-haskell-packages?ref=repo"; - CHaP.flake = false; + cardano-mainnet-mirror = { + url = "github:input-output-hk/cardano-mainnet-mirror"; + flake = false; + }; - # non-flake nix compatibility - flake-compat.url = "github:edolstra/flake-compat"; - flake-compat.flake = false; + CHaP = { + url = "github:intersectmbo/cardano-haskell-packages?ref=repo"; + flake = false; + }; }; outputs = inputs: let @@ -28,32 +40,9 @@ # see flake `variants` below for alternative compilers defaultCompiler = "ghc982"; - haddockShellCompiler = defaultCompiler; - mingwCompiler = "ghc966"; - - cabalHeadOverlay = final: prev: { - cabal-head = - (final.haskell-nix.cabalProject { - # cabal master commit containing https://github.com/haskell/cabal/pull/8726 - # this fixes haddocks generation - src = final.fetchFromGitHub { - owner = "haskell"; - repo = "cabal"; - rev = "6eaba73ac95c62f8dc576e227b5f9c346910303c"; - hash = "sha256-Uu/w6AK61F7XPxtKe+NinuOR4tLbaT6rwxVrQghDQjo="; - }; - index-state = "2024-07-03T00:00:00Z"; - compiler-nix-name = haddockShellCompiler; - cabalProject = '' - packages: Cabal-syntax Cabal cabal-install-solver cabal-install - ''; - configureArgs = "--disable-benchmarks --disable-tests"; - }) - .cabal-install - .components - .exes - .cabal; - }; + # Used for cross compilation, and so referenced in .github/workflows/release-upload.yml. Adapt the + # latter if you change this value. + crossCompilerVersion = "ghc966"; in inputs.flake-utils.lib.eachSystem supportedSystems ( system: let @@ -67,7 +56,6 @@ inputs.haskellNix.overlay # configure haskell.nix to use iohk-nix crypto librairies. inputs.iohkNix.overlays.haskell-nix-crypto - cabalHeadOverlay ]; inherit system; inherit (inputs.haskellNix) config; @@ -83,7 +71,7 @@ # we also want cross compilation to windows on linux (and only with default compiler). crossPlatforms = p: - lib.optional (system == "x86_64-linux" && config.compiler-nix-name == mingwCompiler) + lib.optional (system == "x86_64-linux" && config.compiler-nix-name == crossCompilerVersion) p.mingwW64; # CHaP input map, so we can find CHaP packages (needs to be more @@ -104,20 +92,19 @@ # tools we want in our shell, from hackage shell.tools = { - # for now we're using latest cabal for `cabal haddock-project` fixes - # cabal = "3.10.3.0"; - ghcid = "0.8.8"; + cabal = "3.14.1.1"; } // lib.optionalAttrs (config.compiler-nix-name == defaultCompiler) { - # tools that work or should be used only with default compiler + # tools that work only with default compiler + ghcid = "0.8.9"; cabal-gild = "1.3.1.2"; - fourmolu = "0.16.2.0"; - haskell-language-server.src = nixpkgs.haskell-nix.sources."hls-2.8"; + fourmolu = "0.17.0.0"; + haskell-language-server.src = nixpkgs.haskell-nix.sources."hls-2.9"; hlint = "3.8"; stylish-haskell = "0.14.6.0"; }; # and from nixpkgs or other inputs - shell.nativeBuildInputs = with nixpkgs; [gh jq yq-go actionlint shellcheck cabal-head]; + shell.nativeBuildInputs = with nixpkgs; [gh jq yq-go actionlint shellcheck]; # disable Hoogle until someone request it shell.withHoogle = false; # Skip cross compilers for the shell @@ -152,7 +139,7 @@ flake = cabalProject.flake ( lib.optionalAttrs (system == "x86_64-linux") { # on linux, build/test other supported compilers - variants = lib.genAttrs ["ghc8107" mingwCompiler] (compiler-nix-name: { + variants = lib.genAttrs ["ghc8107" crossCompilerVersion] (compiler-nix-name: { inherit compiler-nix-name; }); } @@ -170,8 +157,7 @@ # This ensure hydra send a status for the required job (even if no change other than commit hash) revision = nixpkgs.writeText "revision" (inputs.self.rev or "dirty"); }; - } - // {haddockShell = devShells.haddockShell;}; + }; legacyPackages = { inherit cabalProject nixpkgs; # also provide hydraJobs through legacyPackages to allow building without system prefix: @@ -183,14 +169,7 @@ profiling = (p.appendModule {modules = [{enableLibraryProfiling = true;}];}).shell; }; in - profilingShell cabalProject - # Add GHC 9.6 shell for haddocks - // { - haddockShell = let - p = cabalProject.appendModule {compiler-nix-name = haddockShellCompiler;}; - in - p.shell // (profilingShell p); - }; + profilingShell cabalProject; # formatter used by nix fmt formatter = nixpkgs.alejandra; }