on hkm/ghc-core-section help sign in
haskell.nix/build.nix
67 lines 2.8 kB history raw
1# This file contains the package set used by the release.nix jobset.
2#
3# It is separate from default.nix because that file is the public API
4# of Haskell.nix, which shouldn't have tests, etc.
6{ nixpkgs ? ./nixpkgs
7# Provide args to the nixpkgs instantiation.
8, system ? builtins.currentSystem
9, crossSystem ? null
10, config ? {}
11, nixpkgsArgs ? { inherit system crossSystem; }
12, ifdLevel ? 1000
13}:
15let
16 haskellNixArgs = import ./default.nix;
17 pkgs = import nixpkgs ({
18 config = haskellNixArgs.config // config;
19 inherit (haskellNixArgs) overlays;
20 } // nixpkgsArgs);
21 haskell = pkgs.haskell-nix;
23in rec {
24 tests = import ./test/default.nix { inherit nixpkgs nixpkgsArgs ifdLevel; };
26 # Scripts for keeping Hackage and Stackage up to date, and CI tasks.
27 # The dontRecurseIntoAttrs prevents these from building on hydra
28 # as not all of them can work in restricted eval mode (as they
29 # are not pure).
30 maintainer-scripts = pkgs.dontRecurseIntoAttrs {
31 update-hackage = haskell.callPackage ./scripts/update-hackage.nix {};
32 update-stackage = haskell.callPackage ./scripts/update-stackage.nix {};
33 update-pins = haskell.callPackage ./scripts/update-pins.nix {};
34 update-docs = pkgs.buildPackages.callPackage ./scripts/update-docs.nix {
35 generatedOptions = import ./scripts/options-doc.nix {
36 # nixpkgs 19.09 changes "Option has no description" from an
37 # error into a warning. That is quite helpful when hardly any
38 # of our options are documented, thanks @oxij.
39 pkgs = import ./nixpkgs { nixpkgs-pin = "release-19.09"; };
40 };
41 };
42 # Because this is going to be used to test caching on hydra, it must not
43 # use the darcs package from the haskell.nix we are testing. For that reason
44 # it uses `pkgs.buildPackages.callPackage` not `haskell.callPackage`
45 # (We could pull in darcs from a known good haskell.nix for hydra to
46 # use)
47 check-hydra = pkgs.buildPackages.callPackage ./scripts/check-hydra.nix {};
48 check-closure-size = pkgs.buildPackages.callPackage ./scripts/check-closure-size.nix {
49 inherit (haskell) nix-tools;
50 };
51 };
53 # These are pure parts of maintainer-script so they can be built by hydra
54 # and added to the cache to speed up buildkite.
55 maintainer-script-cache = pkgs.recurseIntoAttrs (
56 (pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isWindows {
57 inherit (maintainer-scripts) check-hydra;
58 })
59 // (pkgs.lib.optionalAttrs (ifdLevel > 2) {
60 inherit (maintainer-scripts) update-docs check-closure-size;
61 # Some of the dependencies of the impure scripts so that they will
62 # will be in the cache too for buildkite.
63 inherit (pkgs.buildPackages) glibc coreutils git openssh cabal-install nix-prefetch-git;
64 inherit (haskell) nix-tools;
65 })
66 );