hosts: migrate to nilla
This commit is contained in:
parent
7fcb5dfca5
commit
463bd5f849
19 changed files with 78 additions and 205 deletions
47
modules/nilla/configurations.nix
Normal file
47
modules/nilla/configurations.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ config, lib }:
|
||||
{
|
||||
options = {
|
||||
configBuilders = {
|
||||
nixos = lib.options.create {
|
||||
type = lib.types.function lib.types.raw;
|
||||
default.value = _name: config.inputs.nixpkgs.result.lib.nixosSystem;
|
||||
};
|
||||
darwin = lib.options.create {
|
||||
type = lib.types.function lib.types.raw;
|
||||
default.value = _name: config.inputs.darwin.result.lib.darwinSystem;
|
||||
};
|
||||
home = lib.options.create {
|
||||
type = lib.types.function lib.types.raw;
|
||||
default.value = _name: config.inputs.home-manager.result.lib.homeManagerConfiguration;
|
||||
};
|
||||
};
|
||||
|
||||
configurations = {
|
||||
nixos = lib.options.create {
|
||||
type = lib.types.attrs.lazy lib.types.raw;
|
||||
default.value = { };
|
||||
};
|
||||
darwin = lib.options.create {
|
||||
type = lib.types.attrs.lazy lib.types.raw;
|
||||
default.value = { };
|
||||
};
|
||||
home = lib.options.create {
|
||||
type = lib.types.attrs.lazy lib.types.raw;
|
||||
default.value = { };
|
||||
};
|
||||
};
|
||||
|
||||
nixosConfigurations = lib.options.create {
|
||||
type = lib.types.attrs.lazy lib.types.raw;
|
||||
default.value = builtins.mapAttrs config.configBuilders.nixos config.configurations.nixos;
|
||||
};
|
||||
darwinConfigurations = lib.options.create {
|
||||
type = lib.types.attrs.lazy lib.types.raw;
|
||||
default.value = builtins.mapAttrs config.configBuilders.darwin config.configurations.darwin;
|
||||
};
|
||||
homeConfigurations = lib.options.create {
|
||||
type = lib.types.attrs.lazy lib.types.raw;
|
||||
default.value = builtins.mapAttrs config.configBuilders.home config.configurations.home;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -2,5 +2,6 @@
|
|||
includes = [
|
||||
./builders
|
||||
./services.nix
|
||||
./configurations.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -14,14 +14,14 @@ let
|
|||
{
|
||||
options = {
|
||||
host = lib.options.create {
|
||||
type = lib.types.str;
|
||||
type = lib.types.string;
|
||||
};
|
||||
ports = lib.options.create {
|
||||
type = lib.types.list.of lib.types.port;
|
||||
default.value = [ ];
|
||||
};
|
||||
hosts = lib.options.create {
|
||||
type = lib.types.list.of lib.types.str;
|
||||
type = lib.types.list.of lib.types.string;
|
||||
default.value = [ config.host ];
|
||||
};
|
||||
module = lib.options.create {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue