Skip to content

Commit

Permalink
Simplify and fix flake.nix.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jgm committed May 9, 2023
1 parent 9e8e016 commit cfbf83c
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 101 deletions.
87 changes: 26 additions & 61 deletions flake.lock

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

80 changes: 40 additions & 40 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
{
description = "Pandoc development";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
nixpkgs-140774-workaround.url = "github:srid/nixpkgs-140774-workaround";
};

outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.systems.flakeExposed;
imports = [
inputs.haskell-flake.flakeModule
];
perSystem = { self', system, lib, config, pkgs, ... }: {
haskellProjects.main = {
imports = [
inputs.nixpkgs-140774-workaround.haskellFlakeProjectModules.default
];
overrides = self: super: { };
devShell = {
tools = hp: {
inherit (hp)
hlint
ormolu
weeder
stylish-haskell
ghcid;
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";

outputs = inputs:
let
overlay = final: prev: {
haskell = prev.haskell // {
packageOverrides = hfinal: hprev:
prev.haskell.packageOverrides hfinal hprev // {
pandoc = hfinal.callCabal2nix "pandoc" ./. { };
};
hlsCheck.enable = true;
};
packages = {
pandoc.root = ./.;
pandoc-cli.root = ./pandoc-cli;
pandoc-server.root = ./pandoc-server;
pandoc-lua-engine.root = ./pandoc-lua-engine;
};
};

# Default package.
packages.default = self'.packages.pandoc;

devShells.default = self'.devShells.main;
pandoc = final.haskell.lib.compose.justStaticExecutables final.haskellPackages.pandoc;
};
};
perSystem = system:
let
pkgs = import inputs.nixpkgs { inherit system; overlays = [ overlay ]; };
hspkgs = pkgs.haskellPackages;
in
{
devShell = hspkgs.shellFor {
withHoogle = true;
packages = p : [
p.pandoc
];
buildInputs = [
hspkgs.cabal-install
hspkgs.haskell-language-server
hspkgs.hlint
hspkgs.ghcid
hspkgs.ormolu
hspkgs.stylish-haskell
hspkgs.weeder
hspkgs.servant-server
hspkgs.hslua
pkgs.bashInteractive
];
};
defaultPackage = pkgs.pandoc;
};
in
{ inherit overlay; } //
inputs.flake-utils.lib.eachDefaultSystem perSystem;
}

0 comments on commit cfbf83c

Please sign in to comment.