Bruno BELANYI
dd7134ca3e
This will allow other modules to cross-reference which hosts exist on which system. My main use-case is to automatically declare home-manager configuration for the home configuration of NixOS hosts. I also include Darwin in case I ever want to use that in the future, though that is unlikely for the moment.
22 lines
460 B
Nix
22 lines
460 B
Nix
# Define `hosts.{darwin,home,nixos}` options for consumption in other modules
|
|
{ lib, ... }:
|
|
let
|
|
mkHostsOption = description: lib.mkOption {
|
|
inherit description;
|
|
type = with lib.types; attrsOf str;
|
|
default = { };
|
|
example = { name = "x86_64-linux"; };
|
|
};
|
|
in
|
|
{
|
|
options = {
|
|
hosts = {
|
|
darwin = mkHostsOption "Darwin hosts";
|
|
|
|
homes = mkHostsOption "Home Manager hosts";
|
|
|
|
nixos = mkHostsOption "NixOS hosts";
|
|
};
|
|
};
|
|
}
|