diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 36bd19c..09c1116 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,7 +37,7 @@ jobs: # Group the output by platform. RUNS=$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/check-runs" --paginate) echo "checks..." - FILTERED=$(jq -c -r '.check_runs[] | select(.name | endswith("-env")) | select(.name | startswith("${{ inputs.platform }}")) | { "config": .name, "build_path": .output.text, "short_name": .name | sub("${{ inputs.platform }}\\.";"") }' <<< "$RUNS") + FILTERED=$(jq -c -r '.check_runs[] | select(.name | endswith("-env")) | select(.name | startswith("${{ inputs.platform }}")) | { "config": .name, "build_path": .output.summary, "short_name": .name | sub("${{ inputs.platform }}\\.";"") }' <<< "$RUNS") jq . <<< "$FILTERED" MATRIX=$(jq --slurp -c -r '.' <<< "$FILTERED") jq . <<< "$MATRIX" @@ -86,7 +86,7 @@ jobs: # codespace-upload: # env: # IMAGE_NAME: input-output-hk/devx-devcontainer - # needs: ghcr-upload + # needs: process # permissions: # packages: write # runs-on: ubuntu-latest diff --git a/cross-js.nix b/cross-js.nix index 28408a5..3472427 100644 --- a/cross-js.nix +++ b/cross-js.nix @@ -1,7 +1,7 @@ { self, pkgs, compiler, compiler-nix-name, toolsModule, withHLS ? true, withHlint ? true, withIOG ? true }: -let tool-version-map = import ./tool-map.nix; +let tool-version-map = (import ./tool-map.nix) self; tool = tool-name: pkgs.pkgsBuildBuild.haskell-nix.tool compiler-nix-name tool-name [(tool-version-map compiler-nix-name tool-name) toolsModule]; - cabal-install = pkgs.pkgsBuildBuild.haskell-nix.nix-tools-unchecked.exes.cabal; + cabal-install = tool "cabal"; haskell-tools = pkgs.lib.optionalAttrs (withHLS && (compiler-not-in ( # it appears we can't get HLS build with 9.8 yet. diff --git a/cross-windows.nix b/cross-windows.nix index af59d75..58c2440 100644 --- a/cross-windows.nix +++ b/cross-windows.nix @@ -1,7 +1,7 @@ { self, pkgs, compiler, compiler-nix-name, toolsModule, withHLS ? true, withHlint ? true, withIOG ? true }: -let tool-version-map = import ./tool-map.nix; +let tool-version-map = (import ./tool-map.nix) self; tool = tool-name: pkgs.pkgsBuildBuild.haskell-nix.tool compiler-nix-name tool-name [(tool-version-map compiler-nix-name tool-name) toolsModule]; - cabal-install = pkgs.pkgsBuildBuild.haskell-nix.nix-tools-unchecked.exes.cabal; + cabal-install = tool "cabal"; haskell-tools = pkgs.lib.optionalAttrs (withHLS && (compiler-not-in ( # it appears we can't get HLS build with 9.8 yet. diff --git a/dynamic.nix b/dynamic.nix index 73bc796..828d164 100644 --- a/dynamic.nix +++ b/dynamic.nix @@ -1,8 +1,8 @@ # define a development shell for dynamically linked applications (default) { self, pkgs, compiler, compiler-nix-name, toolsModule, withHLS ? true, withHlint ? true, withIOG ? true, withIOGFull ? false, withGHCTooling ? false }: -let tool-version-map = import ./tool-map.nix; +let tool-version-map = (import ./tool-map.nix) self; tool = tool-name: pkgs.pkgsBuildBuild.haskell-nix.tool compiler-nix-name tool-name [(tool-version-map compiler-nix-name tool-name) toolsModule]; - cabal-install = pkgs.pkgsBuildBuild.haskell-nix.nix-tools-unchecked.exes.cabal; + cabal-install = tool "cabal"; haskell-tools = pkgs.lib.optionalAttrs (withHLS && (compiler-not-in ( pkgs.lib.optional (builtins.compareVersions compiler.version "9.7" >= 0) compiler-nix-name diff --git a/flake.lock b/flake.lock index 53a23b4..77aedd5 100644 --- a/flake.lock +++ b/flake.lock @@ -33,6 +33,23 @@ "type": "github" } }, + "cabal": { + "flake": false, + "locked": { + "lastModified": 1736333136, + "narHash": "sha256-oG//67jh9+Hi1ctckn9ul1OI7p9U7avQKcytXmIel+0=", + "owner": "hsyl20", + "repo": "cabal", + "rev": "e8538c6597cc355eca705827845f5341d1d815f2", + "type": "github" + }, + "original": { + "owner": "hsyl20", + "ref": "hsyl20/per-file-extra-source-options", + "repo": "cabal", + "type": "github" + } + }, "cabal-32": { "flake": false, "locked": { @@ -155,15 +172,32 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1731112065, - "narHash": "sha256-2S3HZWIxzss14LEp9E9AUqW31qNW4O9eje03//Ba0l8=", + "lastModified": 1739924618, + "narHash": "sha256-PPiZjaAHexQ2pKtZWqLS9a9MFaATG2jjowQcEvk2r1A=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "9bccb2878f8c7bf4461103543f0987970e07d496", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, + "hackage-for-stackage": { + "flake": false, + "locked": { + "lastModified": 1739924608, + "narHash": "sha256-+S96qUWrxY07PJF733kG0n5nso3ErqkMgLB0Qt69N9U=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "8e907f71dab23f31f9acc81dae48fe41234fd6ce", + "rev": "0f08a2e8e9304600cc82a0a940c72a56a778f23a", "type": "github" }, "original": { "owner": "input-output-hk", + "ref": "for-stackage", "repo": "hackage.nix", "type": "github" } @@ -178,6 +212,7 @@ "flake-compat": "flake-compat", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", "hackage": "hackage", + "hackage-for-stackage": "hackage-for-stackage", "hls-1.10": "hls-1.10", "hls-2.0": "hls-2.0", "hls-2.2": "hls-2.2", @@ -189,30 +224,25 @@ "hls-2.8": "hls-2.8", "hls-2.9": "hls-2.9", "hpc-coveralls": "hpc-coveralls", - "hydra": "hydra", "iserv-proxy": "iserv-proxy", "nixpkgs": [ "haskellNix", "nixpkgs-unstable" ], - "nixpkgs-2003": "nixpkgs-2003", - "nixpkgs-2105": "nixpkgs-2105", - "nixpkgs-2111": "nixpkgs-2111", - "nixpkgs-2205": "nixpkgs-2205", - "nixpkgs-2211": "nixpkgs-2211", "nixpkgs-2305": "nixpkgs-2305", "nixpkgs-2311": "nixpkgs-2311", "nixpkgs-2405": "nixpkgs-2405", + "nixpkgs-2411": "nixpkgs-2411", "nixpkgs-unstable": "nixpkgs-unstable", "old-ghc-nix": "old-ghc-nix", "stackage": "stackage" }, "locked": { - "lastModified": 1731113439, - "narHash": "sha256-ZPR+Ap5aLkdve7S8aN2c+J+DQiPBmupm3e6ZPQ0kPo4=", + "lastModified": 1739926307, + "narHash": "sha256-RfLCDwE4kHGvX+hBgB4sYx3UyYEtb4IEr4gOuVzj8Oc=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "e488cf3c7d4e1aa0ffef8f36334de8a8827daca2", + "rev": "29be2a6f5fec17f7385128eee8d8fac28ca65bfa", "type": "github" }, "original": { @@ -407,33 +437,10 @@ "type": "github" } }, - "hydra": { - "inputs": { - "nix": "nix", - "nixpkgs": [ - "haskellNix", - "hydra", - "nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1671755331, - "narHash": "sha256-hXsgJj0Cy0ZiCiYdW2OdBz5WmFyOMKuw4zyxKpgUKm4=", - "owner": "NixOS", - "repo": "hydra", - "rev": "f48f00ee6d5727ae3e488cbf9ce157460853fea8", - "type": "github" - }, - "original": { - "id": "hydra", - "type": "indirect" - } - }, "iohk-nix": { "inputs": { "blst": "blst", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "secp256k1": "secp256k1", "sodium": "sodium" }, @@ -468,135 +475,18 @@ "type": "github" } }, - "lowdown-src": { - "flake": false, - "locked": { - "lastModified": 1633514407, - "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", - "owner": "kristapsdz", - "repo": "lowdown", - "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", - "type": "github" - }, - "original": { - "owner": "kristapsdz", - "repo": "lowdown", - "type": "github" - } - }, - "nix": { - "inputs": { - "lowdown-src": "lowdown-src", - "nixpkgs": "nixpkgs", - "nixpkgs-regression": "nixpkgs-regression" - }, - "locked": { - "lastModified": 1661606874, - "narHash": "sha256-9+rpYzI+SmxJn+EbYxjGv68Ucp22bdFUSy/4LkHkkDQ=", - "owner": "NixOS", - "repo": "nix", - "rev": "11e45768b34fdafdcf019ddbd337afa16127ff0f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "2.11.0", - "repo": "nix", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1657693803, - "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "365e1b3a859281cf11b94f87231adeabbdd878a2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-22.05-small", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2003": { - "locked": { - "lastModified": 1620055814, - "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-20.03-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2105": { - "locked": { - "lastModified": 1659914493, - "narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-21.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2111": { - "locked": { - "lastModified": 1659446231, - "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-21.11-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2205": { - "locked": { - "lastModified": 1685573264, - "narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "380be19fbd2d9079f677978361792cb25e8a3635", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-22.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2211": { - "locked": { - "lastModified": 1688392541, - "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", - "owner": "NixOS", + "lastModified": 1684171562, + "narHash": "sha256-BMUWjVWAUdyMWKk0ATMC9H0Bv4qAV/TXwwPUvTiC5IQ=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", + "rev": "55af203d468a6f5032a519cba4f41acf5a74b638", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-22.11-darwin", + "owner": "nixos", + "ref": "release-22.11", "repo": "nixpkgs", "type": "github" } @@ -635,11 +525,11 @@ }, "nixpkgs-2405": { "locked": { - "lastModified": 1729242558, - "narHash": "sha256-VgcLDu4igNT0eYua6OAl9pWCI0cYXhDbR+pWP44tte0=", + "lastModified": 1735564410, + "narHash": "sha256-HB/FA0+1gpSs8+/boEavrGJH+Eq08/R2wWNph1sM1Dg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4a3f2d3195b60d07530574988df92e049372c10e", + "rev": "1e7a8f391f1a490460760065fa0630b5520f9cf8", "type": "github" }, "original": { @@ -649,29 +539,29 @@ "type": "github" } }, - "nixpkgs-regression": { + "nixpkgs-2411": { "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "lastModified": 1737255904, + "narHash": "sha256-r3fxHvh+M/mBgCZXOACzRFPsJdix2QSsKazb7VCXXo0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "rev": "eacdab35066b0bb1c9413c96898e326b76398a81", "type": "github" }, "original": { "owner": "NixOS", + "ref": "nixpkgs-24.11-darwin", "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", "type": "github" } }, "nixpkgs-unstable": { "locked": { - "lastModified": 1729980323, - "narHash": "sha256-eWPRZAlhf446bKSmzw6x7RWEE4IuZgAp8NW3eXZwRAY=", + "lastModified": 1737110817, + "narHash": "sha256-DSenga8XjPaUV5KUFW/i3rNkN7jm9XmguW+qQ1ZJTR4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "86e78d3d2084ff87688da662cf78c2af085d8e73", + "rev": "041c867bad68dfe34b78b2813028a2e2ea70a23c", "type": "github" }, "original": { @@ -681,22 +571,6 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1684171562, - "narHash": "sha256-BMUWjVWAUdyMWKk0ATMC9H0Bv4qAV/TXwwPUvTiC5IQ=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "55af203d468a6f5032a519cba4f41acf5a74b638", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "release-22.11", - "repo": "nixpkgs", - "type": "github" - } - }, "old-ghc-nix": { "flake": false, "locked": { @@ -716,12 +590,13 @@ }, "root": { "inputs": { + "cabal": "cabal", "flake-utils": "flake-utils", "haskellNix": "haskellNix", "iohk-nix": "iohk-nix", "nixpkgs": [ "haskellNix", - "nixpkgs-unstable" + "nixpkgs-2411" ] } }, @@ -762,11 +637,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1731111056, - "narHash": "sha256-Hbt6LEa4NzKeowqXTUx718NNqBQNeIknoyx9fWybuZo=", + "lastModified": 1739923898, + "narHash": "sha256-HpWOe4a8NLJV7IJ4D8Qyl1CWOqo4oisRUVGHG620nEU=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "1e91852795c506001c6f049978786f477cc5ff9c", + "rev": "a732fe6a5e8b7fb9082f1447b22fa57284be1f4d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index eed2ce9..4043791 100644 --- a/flake.nix +++ b/flake.nix @@ -2,11 +2,13 @@ description = "Minimal devshell flake for haskell"; inputs.haskellNix.url = "github:input-output-hk/haskell.nix"; - inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable"; + inputs.nixpkgs.follows = "haskellNix/nixpkgs-2411"; inputs.flake-utils.url = "github:numtide/flake-utils"; inputs.iohk-nix.url = "github:input-output-hk/iohk-nix"; + inputs.cabal.url = "github:hsyl20/cabal?ref=hsyl20/per-file-extra-source-options"; + inputs.cabal.flake = false; - outputs = { self, nixpkgs, flake-utils, haskellNix, iohk-nix }: + outputs = { self, nixpkgs, flake-utils, haskellNix, iohk-nix, ... }: let overlays = { inherit (iohk-nix.overlays) crypto; # add static-$pkg for a few packages to be able to pull them im explicitly. diff --git a/static.nix b/static.nix index 15ac681..a317185 100644 --- a/static.nix +++ b/static.nix @@ -1,7 +1,7 @@ { self, pkgs, compiler, compiler-nix-name, toolsModule, withHLS ? true, withHlint ? true, withIOG ? true, withIOGFull ? false }: -let tool-version-map = import ./tool-map.nix; +let tool-version-map = (import ./tool-map.nix) self; tool = tool-name: pkgs.pkgsBuildBuild.haskell-nix.tool compiler-nix-name tool-name [(tool-version-map compiler-nix-name tool-name) toolsModule]; - cabal-install = pkgs.pkgsBuildBuild.haskell-nix.nix-tools-unchecked.exes.cabal; + cabal-install = tool "cabal"; haskell-tools = pkgs.lib.optionalAttrs (withHLS && (compiler-not-in ( pkgs.lib.optional (builtins.compareVersions compiler.version "9.7" >= 0) compiler-nix-name) "Haskell Language Server")) { hls = tool "haskell-language-server"; } diff --git a/tool-map.nix b/tool-map.nix index efe43ff..ae0729e 100644 --- a/tool-map.nix +++ b/tool-map.nix @@ -1,4 +1,4 @@ -# see https://haskell-language-server.readthedocs.io/en/latest/support/ghc-version-support.html +self: # see https://haskell-language-server.readthedocs.io/en/latest/support/ghc-version-support.html # so we assume "latest" for all hls. # for hlint however, we need hlint-3.3 for ghc-8.10.7. let @@ -15,9 +15,9 @@ let f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d - --sha256: sha256-aVI93DtHziicNn2mGli0YE+bC5BeT7mOQQETp2Thi68= + --sha256: sha256-+hzciiQqWb5oOzQ2JZ2lzJGfGuwA3ZigeWgAQ8Dz+kk= - if impl(ghc < 9.11) + if impl(ghc < 9.13) active-repositories: hackage.haskell.org else active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org @@ -45,4 +45,15 @@ compiler-nix-name: tool: { }; happy = { version = "1.20.1.1"; inherit cabalProjectLocal; }; alex = { version = "3.2.7.3"; inherit cabalProjectLocal; }; + cabal = { + src = self.inputs.cabal; + # We use the cabal.boostrap.project file, as we don't + # want an of the cabal complexities they have. The + # bootstrap file, also neatly doesn't do any `import`s. + # which would require us to muck around with the source filter like + # + # cabal = { src = { outPath = self.inputs.cabal; filterPath = { path, ... }: path; }; } + # + cabalProjectFileName = "cabal.bootstrap.project"; + }; }.${tool} or fixed-versions.${tool}.${compiler-nix-name} or {}