mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-03-13 18:19:00 +00:00
flake-parts/setups/nixos: add shouldbePartOfNixOSConfigurations
This allows explicitly including a NixOS config even with the unfulfilled conditions. With deploy-rs nodes, they're pretty specific so we'll opt for this solution.
This commit is contained in:
parent
cf64ff7490
commit
22e3a09243
@ -323,6 +323,16 @@ let
|
||||
the NixOS configuration.
|
||||
'';
|
||||
};
|
||||
|
||||
shouldBePartOfNixOSConfigurations = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = lib.isAttrs config.deploy || config.formats == null;
|
||||
example = true;
|
||||
description = ''
|
||||
Indicates whether the declarative NixOS setup should be included as
|
||||
part of the `nixosConfigurations` flake output.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config.modules = [
|
||||
@ -571,7 +581,7 @@ in
|
||||
pureNixosConfigs =
|
||||
let
|
||||
validConfigs =
|
||||
lib.filterAttrs (_: v: v.formats == null || v.deploy != null) cfg.configs;
|
||||
lib.filterAttrs (_: v: v.shouldBePartOfNixOSConfigurations) cfg.configs;
|
||||
|
||||
generatePureConfigs = hostname: metadata:
|
||||
lib.listToAttrs
|
||||
|
Loading…
Reference in New Issue
Block a user