|
1 | 1 | {
|
2 | 2 | description = "Pandoc development";
|
3 |
| - inputs = { |
4 |
| - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; |
5 |
| - flake-parts.url = "github:hercules-ci/flake-parts"; |
6 |
| - haskell-flake.url = "github:srid/haskell-flake"; |
7 |
| - nixpkgs-140774-workaround.url = "github:srid/nixpkgs-140774-workaround"; |
8 |
| - }; |
9 | 3 |
|
10 |
| - outputs = inputs@{ self, nixpkgs, flake-parts, ... }: |
11 |
| - flake-parts.lib.mkFlake { inherit inputs; } { |
12 |
| - systems = nixpkgs.lib.systems.flakeExposed; |
13 |
| - imports = [ |
14 |
| - inputs.haskell-flake.flakeModule |
15 |
| - ]; |
16 |
| - perSystem = { self', system, lib, config, pkgs, ... }: { |
17 |
| - haskellProjects.main = { |
18 |
| - imports = [ |
19 |
| - inputs.nixpkgs-140774-workaround.haskellFlakeProjectModules.default |
20 |
| - ]; |
21 |
| - overrides = self: super: { }; |
22 |
| - devShell = { |
23 |
| - tools = hp: { |
24 |
| - inherit (hp) |
25 |
| - hlint |
26 |
| - ormolu |
27 |
| - weeder |
28 |
| - stylish-haskell |
29 |
| - ghcid; |
| 4 | + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; |
| 5 | + inputs.flake-utils.url = "github:numtide/flake-utils"; |
| 6 | + |
| 7 | + outputs = inputs: |
| 8 | + let |
| 9 | + overlay = final: prev: { |
| 10 | + haskell = prev.haskell // { |
| 11 | + packageOverrides = hfinal: hprev: |
| 12 | + prev.haskell.packageOverrides hfinal hprev // { |
| 13 | + pandoc = hfinal.callCabal2nix "pandoc" ./. { }; |
30 | 14 | };
|
31 |
| - hlsCheck.enable = true; |
32 |
| - }; |
33 |
| - packages = { |
34 |
| - pandoc.root = ./.; |
35 |
| - pandoc-cli.root = ./pandoc-cli; |
36 |
| - pandoc-server.root = ./pandoc-server; |
37 |
| - pandoc-lua-engine.root = ./pandoc-lua-engine; |
38 |
| - }; |
39 | 15 | };
|
40 |
| - |
41 |
| - # Default package. |
42 |
| - packages.default = self'.packages.pandoc; |
43 |
| - |
44 |
| - devShells.default = self'.devShells.main; |
| 16 | + pandoc = final.haskell.lib.compose.justStaticExecutables final.haskellPackages.pandoc; |
45 | 17 | };
|
46 |
| - }; |
| 18 | + perSystem = system: |
| 19 | + let |
| 20 | + pkgs = import inputs.nixpkgs { inherit system; overlays = [ overlay ]; }; |
| 21 | + hspkgs = pkgs.haskellPackages; |
| 22 | + in |
| 23 | + { |
| 24 | + devShell = hspkgs.shellFor { |
| 25 | + withHoogle = true; |
| 26 | + packages = p : [ |
| 27 | + p.pandoc |
| 28 | + ]; |
| 29 | + buildInputs = [ |
| 30 | + hspkgs.cabal-install |
| 31 | + hspkgs.haskell-language-server |
| 32 | + hspkgs.hlint |
| 33 | + hspkgs.ghcid |
| 34 | + hspkgs.ormolu |
| 35 | + hspkgs.stylish-haskell |
| 36 | + hspkgs.weeder |
| 37 | + hspkgs.servant-server |
| 38 | + hspkgs.hslua |
| 39 | + pkgs.bashInteractive |
| 40 | + ]; |
| 41 | + }; |
| 42 | + defaultPackage = pkgs.pandoc; |
| 43 | + }; |
| 44 | + in |
| 45 | + { inherit overlay; } // |
| 46 | + inputs.flake-utils.lib.eachDefaultSystem perSystem; |
47 | 47 | }
|
0 commit comments