Skip to content

Commit cfbf83c

Browse files
committed
Simplify and fix flake.nix.
We don't need the workarounds any more. We no longer include pandoc-cli, pandoc-server, or pandoc-lua-engine in the packages. Instead, add some of the heavier dependencies to the list of build inputs. This is at least a temporary solution to #8818.
1 parent 9e8e016 commit cfbf83c

File tree

2 files changed

+66
-101
lines changed

2 files changed

+66
-101
lines changed

flake.lock

Lines changed: 26 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
{
22
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-
};
93

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" ./. { };
3014
};
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-
};
3915
};
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;
4517
};
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;
4747
}

0 commit comments

Comments
 (0)