mirror of
https://github.com/ilyakooo0/haskell.nix.git
synced 2024-09-11 06:55:40 +03:00
This adds a way to specify the `evalSystem` or `evalPackages` explicitly when calling the `project` functions. Currently if we want to make a `flake` that supports multiple systems we have few options: * Require builders for all the supported systems (even just for `nix flake show`). * Pass `--impure` so that haskell.nix can see `builtins.currentSystem` to set up `pkgs.evalPackages` to use that. Unfortunately this prevents nix from caching some of the work it does and often results in it recalculating for each supported system when it would otherwise be cached and take no time at all. * Add an overlay to replace `evalPackages`. This works, but it is not straight forward. * Materialize the nix files for the project. This change allows `evalSystem = "x86_64-linux";` to be passed telling `haskell.nix` to run `cabal` and `nix-tools` on that system. The user will have to have a builder for that system, but does not need to have builders for the others (unless building outputs for them).
21 lines
974 B
Nix
21 lines
974 B
Nix
{ pkgs, lib, stdenv, haskell-nix, testSrc, zlib, compiler-nix-name, evalPackages, recurseIntoAttrs } : recurseIntoAttrs {
|
|
# The version of pandoc used in this test does not build with ghcjs or ghc 8.10
|
|
meta.disabled = stdenv.hostPlatform.isGhcjs
|
|
|| builtins.compareVersions pkgs.buildPackages.haskell-nix.compiler.${compiler-nix-name}.version "8.10" >= 0;
|
|
build = lib.addMetaAttrs {
|
|
# A dependency is broken on windows, just run this on unix.
|
|
platforms = lib.platforms.unix;
|
|
} ((haskell-nix.hackage-package {
|
|
inherit compiler-nix-name evalPackages;
|
|
name = "pandoc";
|
|
version = "2.9.2.1";
|
|
# Function that returns a sha256 string by looking up the location
|
|
# and tag in a nested attrset
|
|
sha256map =
|
|
{ "https://github.com/jgm/pandoc-citeproc"."0.17"
|
|
= "0dxx8cp2xndpw3jwiawch2dkrkp15mil7pyx7dvd810pwc22pm2q"; };
|
|
cabalProjectLocal = ''
|
|
allow-newer: *:base
|
|
'';
|
|
}).components.exes.pandoc);
|
|
} |