Skip to content

Commit

Permalink
add GHC 9.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ners committed Feb 4, 2024
1 parent f2debde commit 70f767f
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 69 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@ on:
branches: master
pull_request:
branches: master
workflow_call:

jobs:
build:
name: Nix build
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v24
- uses: cachix/install-nix-action@v25
- uses: ryanccn/attic-action@v0
with:
endpoint: https://cache.ners.ch
cache: haskell
token: ${{ secrets.ATTIC_TOKEN }}
- name: Nix check
run: |
nix flake check \
--accept-flake-config \
--print-build-logs
run: nix flake check --accept-flake-config
- name: Nix build
run: nix build --accept-flake-config
- uses: actions/upload-artifact@v4
with:
path: ./result
26 changes: 17 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
name: "Release"
name: Release
on:
push:
tags:
- v**
release:
types:
- published

jobs:
build:
name: CI
uses: ./.github/workflows/ci.yml
release:
name: Release
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Hackage release
uses: cachix/haskell-release-action@v1
- uses: actions/download-artifact@v4
- uses: brandonchinn178/hackage-publish@rewrite-js
with:
- hackage-token: ${{ secrets.HACKAGE_AUTH_TOKEN }}
hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }}
docsPath: ./artifact/docs
packagesPath: ./artifact/sdist
candidate: true
31 changes: 7 additions & 24 deletions flake.lock

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

65 changes: 35 additions & 30 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@
extra-trusted-public-keys = "haskell:WskuxROW5pPy83rt3ZXnff09gvnu80yovdeKDw5Gi3o=";
};


inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nix-filter.url = "github:numtide/nix-filter";
unix-compat = {
url = "github:haskell-pkg-janitors/unix-compat";
flake = false;
};
};

outputs = inputs:
Expand All @@ -25,46 +20,56 @@
);
hsSrc = pname: root: inputs.nix-filter {
inherit root;
include = [
"app"
"lib"
"src"
"test"
(inputs.nix-filter.lib.matchExt "cabal")
(inputs.nix-filter.lib.matchExt "md")
include = with inputs.nix-filter.lib; [
(matchExt "cabal")
(matchExt "hs")
(matchExt "md")
isDirectory
];
};
pname = "lsp-client";
src = hsSrc pname ./.;
ghcs = [ "ghc92" "ghc94" "ghc96" "ghc98" ];
overlay = final: prev: {
haskell = prev.haskell // {
packageOverrides = lib.composeExtensions prev.haskell.packageOverrides (hfinal: hprev:
with prev.haskell.lib.compose;
{
"${pname}" = hfinal.callCabal2nix pname (hsSrc pname ./.) {
unix-compat = hfinal.callCabal2nix "unix-compat" inputs.unix-compat { };
};
}
);
packageOverrides = lib.composeExtensions
prev.haskell.packageOverrides
(hfinal: hprev: {
"${pname}" = hfinal.callCabal2nix pname src { };
});
};
};
pname = "lsp-client";
ghcs = [ "ghc92" "ghc94" "ghc96" ];
in
foreach inputs.nixpkgs.legacyPackages
(system: pkgs':
let
pkgs = pkgs'.extend overlay;
hps = lib.filterAttrs (ghc: _: elem ghc ghcs) pkgs.haskell.packages;
hps =
lib.filterAttrs (ghc: _: elem ghc ghcs) pkgs.haskell.packages
// { default = pkgs.haskellPackages; };
allPackages =
pkgs.symlinkJoin {
inherit name;
paths = map (hp: hp.${pname}) (attrValues hps);
};
docs = pkgs.haskell.lib.documentationTarball hps.default.${pname};
sdist = hps.default.cabalSdist { name = "${pname}.tar.gz"; inherit src; };
inherit (hps.default.${pname}) name;
default = pkgs.runCommand name { } ''
mkdir $out
cd $out
mkdir docs sdist
ln -s ${allPackages} ${name}
ln -s ${docs}/*.tar.gz docs/
ln -s ${sdist} sdist/${name}.tar.gz
'';
in
{
formatter.${system} = pkgs.nixpkgs-fmt;
legacyPackages.${system} = pkgs;
packages.${system}.default = pkgs.haskellPackages.${pname};
checks.${system}.${pname} = pkgs.buildEnv {
name = pname;
paths = map (hp: hp.${pname}) (attrValues hps);
};
legacyPackages.${system} = { inherit (pkgs) haskell haskellPackages; };
packages.${system} = { inherit default; };
devShells.${system} =
foreach (hps // { default = pkgs.haskellPackages; }) (ghcName: hp: {
foreach hps (ghcName: hp: {
${ghcName} = hp.shellFor {
packages = ps: [ ps.${pname} ];
nativeBuildInputs = with hp; [
Expand Down

0 comments on commit 70f767f

Please sign in to comment.