Skip to content

Commit 4cb5d77

Browse files
author
Your Name
committed
Make darwin/home/nixosModules not be set when no modules are present
Right now, if you use blueprint in a flake, the outputs darwin/home/nixosModules will be set to a empty attribute if there are no modules, this can be easily fixed with `lib.mkIf`. This error also exists with darwin/system/nixosConfigurations, and using `lib.mkIf` will make those lines quite long, I don't have a solution for that currently.
1 parent 658dfdb commit 4cb5d77

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/default.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -590,10 +590,10 @@ let
590590

591591
inherit modules;
592592

593-
darwinModules = modules.darwin or { };
594-
homeModules = modules.home or { };
593+
darwinModules = lib.mkIf (modules.darwin or null != null) (modules.darwin {});
594+
homeModules = lib.mkIf (modules.home or null != null) (modules.home or {});
595595
# TODO: how to extract NixOS tests?
596-
nixosModules = modules.nixos or { };
596+
nixosModules = lib.mkIf (modules.nixos or null != null) (modules.nixos or {});
597597

598598
templates = importDir (src + "/templates") (
599599
entries:

0 commit comments

Comments
 (0)