flake: add hosts
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.
This commit is contained in:
parent
7ac78ca260
commit
1c86c85c56
2 changed files with 22 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ flake-parts.lib.mkFlake { inherit inputs; } {
|
|||
./checks.nix
|
||||
./dev-shells.nix
|
||||
./home-manager.nix
|
||||
./hosts.nix
|
||||
./lib.nix
|
||||
./nixos.nix
|
||||
./overlays.nix
|
||||
|
|
|
|||
21
flake/hosts.nix
Normal file
21
flake/hosts.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue