on bfbbbd3 help sign in
haskell.nix/modules/component-driver.nix
38 lines 1.2 kB history raw
1{ config, pkgs, lib, haskellLib, buildModules, ... }:
2let
3 # TODO: this pkgs is the adjusted pkgs, but pkgs.pkgs is unadjusted
4 new-builder = haskellLib.weakCallPackage pkgs ../builder {
5 inherit haskellLib;
6 ghc = config.ghc.package;
7 buildGHC = buildModules.config.ghc.package;
8 inherit (config) nonReinstallablePkgs;
9 inherit withPackage;
10 };
12 withPackage = import ../builder/with-package-wrapper.nix {
13 inherit lib;
14 inherit (pkgs.buildPackages) stdenv runCommand makeWrapper;
15 inherit (pkgs.buildPackages.xorg) lndir;
16 ghc = config.ghc.package;
17 };
19in
22 options.nonReinstallablePkgs = lib.mkOption {
23 type = lib.types.listOf lib.types.str;
24 };
26 config.nonReinstallablePkgs =
27 [ "rts" "ghc" "ghc-prim" "integer-gmp" "integer-simple" "base"
28 "array" "deepseq" "pretty" "ghc-boot-th" "template-haskell" "ghc-heap" ];
30 options.hsPkgs = lib.mkOption {
31 type = lib.types.unspecified;
32 };
34 config.hsPkgs = { buildPackages = buildModules.config.hsPkgs; }
35 // lib.mapAttrs
36 (name: pkg: if pkg == null then null else new-builder pkg)
37 (config.packages // lib.genAttrs config.nonReinstallablePkgs (_: null));