Skip to content

Commit

Permalink
project: deprecate ghc-8.10.7
Browse files Browse the repository at this point in the history
  • Loading branch information
doyougnu committed Oct 30, 2024
1 parent a99bf39 commit 448bc1a
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 44 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ jobs:
ghc: "9.2.5"
os: ubuntu-latest

- cabal: "3.2"
ghc: "8.10.7"
os: ubuntu-latest

# latest GHC, non-default OS
- cabal: "3.8"
ghc: "9.6"
Expand Down
14 changes: 7 additions & 7 deletions flake.lock

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

73 changes: 47 additions & 26 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,36 +1,57 @@
{
description = "A Klister flake";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
description = "A klister flake";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
overlay = final: prev: {
klister = prev.callCabal2nix "klister" ./. { };
pkgs = nixpkgs.legacyPackages.${system};

hPkgs =
pkgs.haskell.packages."ghc966"; # need to match Stackage LTS version
# from stack.yaml snapshot

myDevTools = [
hPkgs.ghc # GHC compiler in the desired version (will be available on PATH)
hPkgs.ghcid # Continuous terminal Haskell compile checker
hPkgs.ormolu # Haskell formatter
hPkgs.hlint # Haskell codestyle checker
hPkgs.hoogle # Lookup Haskell documentation
hPkgs.haskell-language-server # LSP server for editor
hPkgs.implicit-hie # auto generate LSP hie.yaml file from cabal
hPkgs.retrie # Haskell refactoring tool
# hPkgs.cabal-install
stack-wrapped
pkgs.zlib # External C library needed by some Haskell packages
];

# Wrap Stack to work with our Nix integration. We don't want to modify
# stack.yaml so non-Nix users don't notice anything.
# - no-nix: We don't want Stack's way of integrating Nix.
# --system-ghc # Use the existing GHC on PATH (will come from this Nix file)
# --no-install-ghc # Don't try to install GHC if no matching GHC found on PATH
stack-wrapped = pkgs.symlinkJoin {
name = "stack"; # will be available as the usual `stack` in terminal
paths = [ pkgs.stack ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/stack \
--add-flags "\
--no-nix \
--system-ghc \
--no-install-ghc \
"
'';
};
haskellPackages = pkgs.haskellPackages.extend overlay;
in {
# nix build
packages.default = haskellPackages.klister;
devShells.default = pkgs.mkShell {
buildInputs = myDevTools;

# nix develop
devShells.default = haskellPackages.shellFor {
withHoogle = true;
packages = p: [ p.klister ];
buildInputs = with haskellPackages; [
cabal-install
haskell-language-server
eventlog2html
];
shellHook = ''
export KLISTERPATH="$(pwd)"/examples/
'';
# Make external Nix c libraries like zlib known to GHC, like
# pkgs.haskell.lib.buildStackProject does
# https://github.com/NixOS/nixpkgs/blob/d64780ea0e22b5f61cd6012a456869c702a72f20/pkgs/development/haskell-modules/generic-stack-builder.nix#L38
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath myDevTools;
};
}
);
});
}
2 changes: 1 addition & 1 deletion klister.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ author: David Christiansen <[email protected]>, Samuel Géline
maintainer: David Christiansen <[email protected]>, Samuel Gélineau <[email protected]>
license: BSD-3-Clause
license-file: LICENSE
tested-with: GHC==8.10.7, GHC==9.2.5, GHC==9.4, GHC==9.6
tested-with: GHC==9.2.5, GHC==9.4, GHC==9.6
build-type: Simple
data-files:
stdlib/defun.kl
Expand Down
10 changes: 4 additions & 6 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
resolver: lts-20.25
resolver: lts-22.39
packages:
- .
extra-deps:
- transformers-0.6.1.0@sha256:7e7feea5fc9071375a973a48290fee6664e3eba38eb7028ce04850911f1ad0d4,3146
- mtl-2.3.1
- exceptions-0.10.7
- hedgehog-1.2
- tasty-hedgehog-1.4.0.0@sha256:d29ba1e363d9d41da5b34d4f320ab761cbc9c19fda6091d2d650351604c2d9aa,1795

nix:
enable: true

0 comments on commit 448bc1a

Please sign in to comment.