Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update nix cabal version & flake inputs #1030

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-cabal-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: input-output-hk/setup-haskell@v1
id: setup-haskell
with:
cabal-version: "3.10.1.0"
cabal-version: "3.14.1.1"

- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
ghc: ["9.6", "9.8", "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 }
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/hls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ on:
push:
branches:
- master

permissions:
contents: read

jobs:

test-hls-works:
env:
# Modify this value to "invalidate" the cache.
HLS_CACHE_VERSION: "2024-06-25"

runs-on: ubuntu-latest
timeout-minutes: 60
steps:
Expand All @@ -27,7 +27,7 @@ jobs:
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
nix_path: nixpkgs=channel:nixos-unstable
- name: Open nix environment
uses: rrbutani/use-nix-shell-action@v1
- name: Update dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ jobs:
derivation+="${{ matrix.arch }}"
;;
"x86_64-linux")
derivation+="x86_64-linux.ghc965-x86_64-unknown-linux-musl"
derivation+="x86_64-linux.ghc966-x86_64-unknown-linux-musl"
;;
"aarch64-linux")
derivation+="x86_64-linux.ghc965-aarch64-unknown-linux-musl"
derivation+="x86_64-linux.ghc966-aarch64-unknown-linux-musl"
;;
*)
echo "Unexpected matrix.arch value: ${{ matrix.arch }}"
Expand Down
52 changes: 28 additions & 24 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 17 additions & 33 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@
description = "cardano-cli";

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";
incl.url = "github:divnix/incl";
flake-utils.url = "github:hamishmack/flake-utils/hkm/nested-hydraJobs";

CHaP.url = "github:intersectmbo/cardano-haskell-packages?ref=repo";
CHaP.flake = false;
CHaP = {
url = "github:intersectmbo/cardano-haskell-packages?ref=repo";
flake = false;
};
};

outputs = inputs: let
Expand All @@ -23,30 +32,7 @@
# see flake `variants` below for alternative compilers
defaultCompiler = "ghc982";
haddockShellCompiler = defaultCompiler;
mingwVersion = "ghc965"; # Used for cross compilation, and so referenced in .github/workflows/release-upload.yml. Adapt the latter if you change this value.
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;
};
crossCompilerVersion = "ghc966"; # Used for cross compilation, and so referenced in .github/workflows/release-upload.yml. Adapt the latter if you change this value.
in
{inherit (inputs) incl;}
// inputs.flake-utils.lib.eachSystem supportedSystems (
Expand All @@ -61,7 +47,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;
Expand All @@ -88,7 +73,7 @@

# we also want cross compilation to windows on linux (and only with default compiler).
crossPlatforms = p:
lib.optionals (system == "x86_64-linux" && config.compiler-nix-name == mingwVersion)
lib.optionals (system == "x86_64-linux" && config.compiler-nix-name == crossCompilerVersion)
[
p.mingwW64 # x86_64-windows
p.aarch64-multiplatform-musl # aarch64-linux (static)
Expand All @@ -107,8 +92,7 @@
# 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";
cabal = "3.14.1.1";
ghcid = "0.8.8";
}
// lib.optionalAttrs (config.compiler-nix-name == defaultCompiler) {
Expand All @@ -120,7 +104,7 @@
stylish-haskell = "0.14.6.0";
};
# and from nixpkgs or other inputs
shell.nativeBuildInputs = with nixpkgs; [gh jq yq-go actionlint shellcheck cabal-head] ++ (lib.optional isDarwin macOS-security);
shell.nativeBuildInputs = with nixpkgs; [gh jq yq-go actionlint shellcheck] ++ (lib.optional isDarwin macOS-security);
# disable Hoogle until someone request it
shell.withHoogle = false;
# Skip cross compilers for the shell
Expand Down Expand Up @@ -191,7 +175,7 @@
flake = cabalProject.flake (
lib.optionalAttrs (system == "x86_64-linux") {
# on linux, build/test other supported compilers
variants = lib.genAttrs ["ghc8107" mingwVersion] (compiler-nix-name: {
variants = lib.genAttrs ["ghc8107" crossCompilerVersion] (compiler-nix-name: {
inherit compiler-nix-name;
});
}
Expand Down
Loading