Skip to content

Commit 4c23d68

Browse files
authored
Merge pull request #1030 from IntersectMBO/mgalazyn/chore/update-nix-cabal
Update nix cabal version & flake inputs
2 parents 22726d5 + 374f124 commit 4c23d68

File tree

6 files changed

+53
-65
lines changed

6 files changed

+53
-65
lines changed

.github/workflows/check-cabal-files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: input-output-hk/setup-haskell@v1
1919
id: setup-haskell
2020
with:
21-
cabal-version: "3.10.1.0"
21+
cabal-version: "3.14.1.1"
2222

2323
- uses: actions/checkout@v3
2424

.github/workflows/haskell.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
ghc: ["9.6", "9.8", "9.10"]
24-
cabal: ["3.12"]
24+
cabal: ["3.14"]
2525
sys:
2626
- { os: windows-latest, shell: 'C:/msys64/usr/bin/bash.exe -e {0}' }
2727
- { os: ubuntu-latest, shell: bash }

.github/workflows/hls.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ on:
55
push:
66
branches:
77
- master
8-
8+
99
permissions:
1010
contents: read
11-
11+
1212
jobs:
1313

1414
test-hls-works:
1515
env:
1616
# Modify this value to "invalidate" the cache.
1717
HLS_CACHE_VERSION: "2024-06-25"
18-
18+
1919
runs-on: ubuntu-latest
2020
timeout-minutes: 60
2121
steps:
@@ -27,7 +27,7 @@ jobs:
2727
extra_nix_config: |
2828
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
2929
substituters = https://cache.iog.io/ https://cache.nixos.org/
30-
nix_path: nixpkgs=channel:nixos-unstable
30+
nix_path: nixpkgs=channel:nixos-unstable
3131
- name: Open nix environment
3232
uses: rrbutani/use-nix-shell-action@v1
3333
- name: Update dependencies

.github/workflows/release-upload.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ jobs:
159159
derivation+="${{ matrix.arch }}"
160160
;;
161161
"x86_64-linux")
162-
derivation+="x86_64-linux.ghc965-x86_64-unknown-linux-musl"
162+
derivation+="x86_64-linux.ghc966-x86_64-unknown-linux-musl"
163163
;;
164164
"aarch64-linux")
165-
derivation+="x86_64-linux.ghc965-aarch64-unknown-linux-musl"
165+
derivation+="x86_64-linux.ghc966-aarch64-unknown-linux-musl"
166166
;;
167167
*)
168168
echo "Unexpected matrix.arch value: ${{ matrix.arch }}"

flake.lock

Lines changed: 28 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@
22
description = "cardano-cli";
33

44
inputs = {
5-
haskellNix.url = "github:input-output-hk/haskell.nix";
5+
hackageNix = {
6+
url = "github:input-output-hk/hackage.nix";
7+
flake = false;
8+
};
9+
haskellNix = {
10+
url = "github:input-output-hk/haskell.nix?ref=2024.09.15";
11+
inputs.hackage.follows = "hackageNix";
12+
};
613
nixpkgs.follows = "haskellNix/nixpkgs-unstable";
714
iohkNix.url = "github:input-output-hk/iohk-nix";
815
incl.url = "github:divnix/incl";
916
flake-utils.url = "github:hamishmack/flake-utils/hkm/nested-hydraJobs";
1017

11-
CHaP.url = "github:intersectmbo/cardano-haskell-packages?ref=repo";
12-
CHaP.flake = false;
18+
CHaP = {
19+
url = "github:intersectmbo/cardano-haskell-packages?ref=repo";
20+
flake = false;
21+
};
1322
};
1423

1524
outputs = inputs: let
@@ -23,30 +32,7 @@
2332
# see flake `variants` below for alternative compilers
2433
defaultCompiler = "ghc982";
2534
haddockShellCompiler = defaultCompiler;
26-
mingwVersion = "ghc965"; # Used for cross compilation, and so referenced in .github/workflows/release-upload.yml. Adapt the latter if you change this value.
27-
cabalHeadOverlay = final: prev: {
28-
cabal-head =
29-
(final.haskell-nix.cabalProject {
30-
# cabal master commit containing https://github.com/haskell/cabal/pull/8726
31-
# this fixes haddocks generation
32-
src = final.fetchFromGitHub {
33-
owner = "haskell";
34-
repo = "cabal";
35-
rev = "6eaba73ac95c62f8dc576e227b5f9c346910303c";
36-
hash = "sha256-Uu/w6AK61F7XPxtKe+NinuOR4tLbaT6rwxVrQghDQjo=";
37-
};
38-
index-state = "2024-07-03T00:00:00Z";
39-
compiler-nix-name = haddockShellCompiler;
40-
cabalProject = ''
41-
packages: Cabal-syntax Cabal cabal-install-solver cabal-install
42-
'';
43-
configureArgs = "--disable-benchmarks --disable-tests";
44-
})
45-
.cabal-install
46-
.components
47-
.exes
48-
.cabal;
49-
};
35+
crossCompilerVersion = "ghc966"; # Used for cross compilation, and so referenced in .github/workflows/release-upload.yml. Adapt the latter if you change this value.
5036
in
5137
{inherit (inputs) incl;}
5238
// inputs.flake-utils.lib.eachSystem supportedSystems (
@@ -61,7 +47,6 @@
6147
inputs.haskellNix.overlay
6248
# configure haskell.nix to use iohk-nix crypto librairies.
6349
inputs.iohkNix.overlays.haskell-nix-crypto
64-
cabalHeadOverlay
6550
];
6651
inherit system;
6752
inherit (inputs.haskellNix) config;
@@ -88,7 +73,7 @@
8873

8974
# we also want cross compilation to windows on linux (and only with default compiler).
9075
crossPlatforms = p:
91-
lib.optionals (system == "x86_64-linux" && config.compiler-nix-name == mingwVersion)
76+
lib.optionals (system == "x86_64-linux" && config.compiler-nix-name == crossCompilerVersion)
9277
[
9378
p.mingwW64 # x86_64-windows
9479
p.aarch64-multiplatform-musl # aarch64-linux (static)
@@ -107,8 +92,7 @@
10792
# tools we want in our shell, from hackage
10893
shell.tools =
10994
{
110-
# for now we're using latest cabal for `cabal haddock-project` fixes
111-
# cabal = "3.10.3.0";
95+
cabal = "3.14.1.1";
11296
ghcid = "0.8.8";
11397
}
11498
// lib.optionalAttrs (config.compiler-nix-name == defaultCompiler) {
@@ -120,7 +104,7 @@
120104
stylish-haskell = "0.14.6.0";
121105
};
122106
# and from nixpkgs or other inputs
123-
shell.nativeBuildInputs = with nixpkgs; [gh jq yq-go actionlint shellcheck cabal-head] ++ (lib.optional isDarwin macOS-security);
107+
shell.nativeBuildInputs = with nixpkgs; [gh jq yq-go actionlint shellcheck] ++ (lib.optional isDarwin macOS-security);
124108
# disable Hoogle until someone request it
125109
shell.withHoogle = false;
126110
# Skip cross compilers for the shell
@@ -191,7 +175,7 @@
191175
flake = cabalProject.flake (
192176
lib.optionalAttrs (system == "x86_64-linux") {
193177
# on linux, build/test other supported compilers
194-
variants = lib.genAttrs ["ghc8107" mingwVersion] (compiler-nix-name: {
178+
variants = lib.genAttrs ["ghc8107" crossCompilerVersion] (compiler-nix-name: {
195179
inherit compiler-nix-name;
196180
});
197181
}

0 commit comments

Comments
 (0)