Skip to content

Commit bc1de42

Browse files
authored
Fix #1587: the option shell.buildInputs does not exist ... (#1598)
1 parent 3c9acea commit bc1de42

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

Diff for: builder/shell-for.nix

+7-5
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@ let
7878
++ lib.optionals packageSetupDeps (map (p: p.setup.config)
7979
(lib.filter (p: p.buildType != "Simple") selectedPackages));
8080

81-
name = if lib.length selectedPackages == 1
81+
identifierName = if lib.length selectedPackages == 1
8282
then "ghc-shell-for-${(lib.head selectedPackages).identifier.name}"
8383
else "ghc-shell-for-packages";
8484

85+
name = if (mkDrvArgs.name or null) == null then identifierName else mkDrvArgs.name;
86+
8587
# We need to remove any dependencies which would bring in selected components (see above).
8688
packageInputs = removeSelectedInputs (lib.concatMap (cfg: cfg.depends) selectedConfigs)
8789
++ additionalPackages;
@@ -104,14 +106,14 @@ let
104106
doExactConfig = false;
105107
};
106108
configFiles = makeConfigFiles {
107-
fullName = args.name or name;
108-
identifier.name = name;
109+
fullName = name;
110+
identifier.name = identifierName;
109111
inherit component enableDWARF;
110112
chooseDrv = p: if withHaddock && p ? haddock then p.haddock else p;
111113
};
112114
ghcEnv = ghcForComponent {
113115
inherit configFiles;
114-
componentName = name;
116+
componentName = identifierName;
115117
postInstall = lib.optionalString withHoogle' ''
116118
ln -s ${hoogleIndex}/bin/hoogle $out/bin
117119
'';
@@ -145,7 +147,7 @@ let
145147
mkDrvArgs = builtins.removeAttrs args ["packages" "components" "additional" "withHoogle" "tools"];
146148
in
147149
mkShell (mkDrvArgs // {
148-
name = mkDrvArgs.name or name;
150+
inherit name;
149151

150152
buildInputs = systemInputs
151153
++ mkDrvArgs.buildInputs or [];

Diff for: modules/shell.nix

+28
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{ projectConfig }:
22
{ lib, config, pkgs, haskellLib, ... }: {
33
options = {
4+
name = lib.mkOption {
5+
type = lib.types.nullOr lib.types.str;
6+
default = null;
7+
};
48
packages = lib.mkOption {
59
type = lib.types.unspecified;
610
default = ps: builtins.attrValues (haskellLib.selectLocalPackages ps);
@@ -41,5 +45,29 @@
4145
type = lib.types.unspecified;
4246
default = projectConfig.crossPlatforms;
4347
};
48+
49+
# mkShell args
50+
inputsFrom = lib.mkOption {
51+
type = lib.types.listOf lib.types.unspecified;
52+
default = [];
53+
};
54+
shellHook = lib.mkOption {
55+
type = lib.types.str;
56+
default = "";
57+
};
58+
59+
# mkDerivation args
60+
buildInputs = lib.mkOption {
61+
type = lib.types.listOf lib.types.unspecified;
62+
default = [];
63+
};
64+
nativeBuildInputs = lib.mkOption {
65+
type = lib.types.listOf lib.types.unspecified;
66+
default = [];
67+
};
68+
passthru = lib.mkOption {
69+
type = lib.types.attrsOf lib.types.unspecified;
70+
default = {};
71+
};
4472
};
4573
}

0 commit comments

Comments
 (0)