Skip to content

Commit 696f22d

Browse files
committed
Support library-less cabal files.
1 parent 373ac25 commit 696f22d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ with haskellLib;
4444
applyLibrary = cname: f { cname = config.package.identifier.name; ctype = "lib"; };
4545
applySubComp = ctype: cname: f { inherit cname; ctype = componentPrefix.${ctype}; };
4646
applyAllComp = f { cname = config.package.identifier.name; ctype = "all"; };
47-
libComp = lib.mapAttrs applyLibrary (removeAttrs comps (subComponentTypes ++ [ "all" ]));
47+
libComp = if comps.library == null then {} else lib.mapAttrs applyLibrary (removeAttrs comps (subComponentTypes ++ [ "all" ]));
4848
subComps = lib.mapAttrs
4949
(ctype: lib.mapAttrs (applySubComp ctype))
5050
(builtins.intersectAttrs (lib.genAttrs subComponentTypes (_: null)) comps);

modules/package.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ in {
160160
};
161161
in {
162162
library = mkOption {
163-
type = componentType;
163+
type = nullOr componentType;
164+
default = null;
164165
};
165166
sublibs = mkOption {
166167
type = attrsOf componentType;

0 commit comments

Comments
 (0)