|
1 | 1 | {
|
2 | 2 | inputs = {
|
3 |
| - "nixos-23.05".url = "github:NixOS/nixpkgs/nixos-23.05"; |
| 3 | + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; |
4 | 4 | flake-utils.url = "github:numtide/flake-utils";
|
5 | 5 | };
|
6 |
| - outputs = inputs@{ self, ... }: |
7 |
| - let packageName = "lazy-async"; |
8 |
| - in inputs.flake-utils.lib.eachDefaultSystem (system: |
| 6 | + |
| 7 | + outputs = inputs: |
| 8 | + inputs.flake-utils.lib.eachDefaultSystem (system: |
9 | 9 | let
|
10 |
| - nixpkgs = { |
11 |
| - "nixos-23.05" = import inputs."nixos-23.05" { inherit system; }; |
12 |
| - }; |
13 |
| - pkgs = nixpkgs."nixos-23.05"; |
14 |
| - project = pkgs.haskellPackages.developPackage { |
15 |
| - root = ./lazy-async; |
16 |
| - name = packageName; |
17 |
| - }; |
| 10 | + pkgs = import inputs.nixpkgs { inherit system; }; |
| 11 | + |
18 | 12 | inherit (pkgs.lib) fold composeExtensions concatMap attrValues;
|
19 | 13 |
|
| 14 | + hls = pkgs.haskell-language-server.override { |
| 15 | + supportedGhcVersions = [ "98" ]; |
| 16 | + }; |
| 17 | + |
20 | 18 | combineOverrides = old:
|
21 | 19 | fold composeExtensions (old.overrides or (_: _: { }));
|
22 | 20 |
|
23 |
| - in |
24 |
| - { |
25 |
| - defaultPackage = self.packages.${system}.${packageName}; |
26 |
| - |
27 |
| - packages = { |
28 |
| - "${packageName}" = project; |
29 |
| - |
30 |
| - testConfigurations = |
31 |
| - let |
32 |
| - |
33 |
| - inherit (pkgs.haskell.lib) dontCheck; |
34 |
| - |
35 |
| - makeTestConfiguration = |
36 |
| - let defaultPkgs = pkgs; |
37 |
| - in { pkgs ? defaultPkgs, ghcVersion, overrides ? new: old: { } }: |
38 |
| - let inherit (pkgs.haskell.lib) dontCheck packageSourceOverrides; |
39 |
| - in (pkgs.haskell.packages.${ghcVersion}.override (old: { |
40 |
| - overrides = combineOverrides old [ |
41 |
| - (packageSourceOverrides { |
42 |
| - lazy-async = ./lazy-async; |
43 |
| - }) |
44 |
| - overrides |
45 |
| - ]; |
46 |
| - |
47 |
| - })).lazy-async; |
| 21 | + in rec { |
| 22 | + |
| 23 | + packages = let |
| 24 | + makeTestConfiguration = { ghcVersion, overrides ? new: old: { } }: |
| 25 | + let inherit (pkgs.haskell.lib) dontCheck packageSourceOverrides; |
| 26 | + in (pkgs.haskell.packages.${ghcVersion}.override (old: { |
| 27 | + overrides = combineOverrides old [ |
| 28 | + (packageSourceOverrides { lazy-async = ./lazy-async; }) |
| 29 | + overrides |
| 30 | + ]; |
| 31 | + })).lazy-async; |
| 32 | + in rec { |
| 33 | + ghc-9-6 = makeTestConfiguration { ghcVersion = "ghc96"; }; |
| 34 | + ghc-9-8 = makeTestConfiguration { ghcVersion = "ghc98"; }; |
| 35 | + all = pkgs.symlinkJoin { |
| 36 | + name = "lazy-async-tests"; |
| 37 | + paths = [ ghc-9-6 ghc-9-8 ]; |
| 38 | + }; |
| 39 | + }; |
48 | 40 |
|
49 |
| - in |
50 |
| - rec { |
51 |
| - ghc-9-0 = makeTestConfiguration { |
52 |
| - pkgs = nixpkgs."nixos-23.05"; |
53 |
| - ghcVersion = "ghc90"; |
54 |
| - }; |
55 |
| - ghc-9-2 = makeTestConfiguration { |
56 |
| - pkgs = nixpkgs."nixos-23.05"; |
57 |
| - ghcVersion = "ghc92"; |
58 |
| - }; |
59 |
| - ghc-9-4 = makeTestConfiguration { |
60 |
| - pkgs = nixpkgs."nixos-23.05"; |
61 |
| - ghcVersion = "ghc94"; |
62 |
| - }; |
63 |
| - all = pkgs.symlinkJoin { |
64 |
| - name = packageName; |
65 |
| - paths = [ ghc-9-0 ghc-9-2 ghc-9-4 ]; |
66 |
| - }; |
67 |
| - }; |
| 41 | + devShells.default = pkgs.mkShell { |
| 42 | + inputsFrom = [ packages.ghc-9-8.env ]; |
| 43 | + buildInputs = [ pkgs.cabal-install ]; |
68 | 44 | };
|
| 45 | + |
69 | 46 | });
|
70 | 47 | }
|
0 commit comments