Skip to content

Commit bd4bb50

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 bd4bb50

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/default.nix

+3-5
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,9 @@ let
439439
);
440440
in
441441
# FIXME: maybe there are two layers to this. The blueprint, and then the mapping to flake outputs.
442+
lib.mkIf (modules ? nixos) {nixosModules = modules.nixos or {};} //
443+
lib.mkIf (modules ? home) {homeModules = modules.home or {};} //
444+
lib.mkIf (modules ? darwin) {darwinModules = modules.darwin or {};} //
442445
{
443446
formatter = eachSystem (
444447
{ pkgs, perSystem, ... }:
@@ -590,11 +593,6 @@ let
590593

591594
inherit modules;
592595

593-
darwinModules = modules.darwin or { };
594-
homeModules = modules.home or { };
595-
# TODO: how to extract NixOS tests?
596-
nixosModules = modules.nixos or { };
597-
598596
templates = importDir (src + "/templates") (
599597
entries:
600598
lib.mapAttrs (

0 commit comments

Comments
 (0)