In your flake.nix you can import a module that adds your options (can also just directly add but a module is probably cleaner):
{
inputs.flakelight.url = "github:nix-community/flakelight";
outputs = { flakelight, ... }:
flakelight ./. {
imports = [ ./nix/flakelightModules/my_module.nix ];
};
}
Then in your module file, you can add options and config using them (same as for nixos or home-manager modules but setting the flakelight options):
{ config, lib, src, flakelight, ... }:
let
inherit (lib.types) lazyAttrsOf any;
in
{
options = {
hosts = mkOption {
type = lazyAttrsOf any;
default = {};
};
};
config = {
nixosConfigurations = fnThatConvertsHostsToNixosConf config.hosts;
};
}
|