Skip to content

Commit

Permalink
Try latest cabal for haddocks
Browse files Browse the repository at this point in the history
  • Loading branch information
carbolymer committed Jul 3, 2024
1 parent 46097e3 commit 66748ce
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 10 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/github-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: "Haddock documentation"

on:
push:
branches:
- main
# FIXME uncomment prior to merge
# branches:
# - main

jobs:
build:
Expand All @@ -18,6 +19,7 @@ jobs:
uses: cachix/install-nix-action@v18
with:
# Use last stable nixos channel and the same nix as in channel:
# FIXME bump channel and nix
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 }}
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

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

34 changes: 29 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,29 @@
# "aarch64-linux" - disable these temporarily because the build is broken
# "aarch64-darwin" - disable these temporarily because the build is broken
];

# see flake `variants` below for alternative compilers
defaultCompiler = "ghc965";
haddockShellCompiler = defaultCompiler;

cabalHeadOverlay = final: prev:
{
cabal-head = (final.haskell-nix.cabalProject {
# cabal master commit containing https://github.com/haskell/cabal/pull/8726
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;
};
in
inputs.flake-utils.lib.eachSystem supportedSystems (
system: let
Expand All @@ -38,15 +61,13 @@
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;
};
inherit (nixpkgs) lib;

# see flake `variants` below for alternative compilers
defaultCompiler = "ghc964";
haddockShellCompiler = defaultCompiler;
# We use cabalProject' to ensure we don't build the plan for
# all systems.
cabalProject = nixpkgs.haskell-nix.cabalProject' ({config, ...}: {
Expand Down Expand Up @@ -77,17 +98,20 @@
# tools we want in our shell, from hackage
shell.tools =
{
cabal = "3.10.3.0";
# for now we're using latest cabal for `cabal haddock-project` fixes
# cabal = "3.10.3.0";
# FIXME bump this
ghcid = "0.8.8";
}
// lib.optionalAttrs (config.compiler-nix-name == defaultCompiler) {
# tools that work or should be used only with default compiler
# FIXME bump those
haskell-language-server.src = nixpkgs.haskell-nix.sources."hls-2.6";
hlint = "3.6.1";
stylish-haskell = "0.14.5.0";
};
# and from nixpkgs or other inputs
shell.nativeBuildInputs = with nixpkgs; [ gh jq yq-go actionlint shellcheck ];
shell.nativeBuildInputs = with nixpkgs; [ gh jq yq-go actionlint shellcheck cabal-head ];
# disable Hoogle until someone request it
shell.withHoogle = false;
# Skip cross compilers for the shell
Expand Down

0 comments on commit 66748ce

Please sign in to comment.