1
1
mirror of https://github.com/juspay/jrec.git synced 2024-10-05 14:47:25 +03:00

nix: Build on GHC 8.8 as well

We are using a different nixpkgs only because that's what default.nix
has been using.
This commit is contained in:
Sridhar Ratnakumar 2023-03-12 20:17:25 -04:00
parent 44f2459ce4
commit 407b588e30
3 changed files with 30 additions and 5 deletions

View File

@ -13,3 +13,5 @@ jobs:
experimental-features = nix-command flakes
- name: Build and test 🔧
run: nix build -j 4 -L
- name: Build and test (GHC 8.8) 🔧
run: nix build -j 4 -L .#jrec-ghc88

View File

@ -34,6 +34,22 @@
"type": "github"
}
},
"nixpkgs-ghc88": {
"locked": {
"lastModified": 1596466290,
"narHash": "sha256-V1vrlYfVEdW4iauUc58LCtorSxLLF+X/PhjD5+dQjeQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "76f2e271a2ef9de3734dcc9d366a42d6bfb18e82",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "76f2e271a2ef",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
@ -55,7 +71,8 @@
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"nixpkgs-ghc88": "nixpkgs-ghc88"
}
}
},

View File

@ -1,6 +1,7 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs-ghc88.url = "github:nixos/nixpkgs/76f2e271a2ef";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs@{ nixpkgs, flake-parts, ... }:
@ -11,17 +12,22 @@
overlay = self: super: {
jrec = self.callCabal2nix "jrec" ./. { };
};
haskellPackages' = pkgs.haskellPackages.extend overlay;
ghcVersions = {
ghc88 = inputs.nixpkgs-ghc88.legacyPackages.${system}.haskellPackages.extend overlay;
ghc92 = pkgs.haskellPackages.extend overlay;
};
in
{
packages.default = haskellPackages'.jrec;
devShells.default = haskellPackages'.shellFor {
packages.default = ghcVersions.ghc92.jrec;
devShells.default = ghcVersions.ghc92.shellFor {
packages = p: [ p.jrec ];
buildInputs = with haskellPackages'; [
buildInputs = with ghcVersions.ghc92; [
cabal-install
haskell-language-server
];
};
# Expose jrec built with GHC 8.8 so it can be tested in CI.
packages.jrec-ghc88 = ghcVersions.ghc88.jrec;
};
};
}