nixos/flakeModules/builders/default.nix

135 lines
3.9 KiB
Nix

{ lib, config, ... }:
{
options.builders =
let
inherit (lib) mkOption;
inherit (lib.types) listOf deferredModule submodule;
in
{
nixosModules = mkOption {
type = listOf deferredModule;
default = [ ];
description = ''
nixos modules to be used by all nixosConfigurations
'';
};
darwinModules = mkOption {
type = listOf deferredModule;
default = [ ];
description = ''
nix-darwin modules to be used by all darwinConfigurations
'';
};
homeModules = mkOption {
type = listOf deferredModule;
default = [ ];
description = ''
home-manager modules to be used by all homeConfigurations
'';
};
configurations = mkOption {
type = submodule {
options = {
nixos = mkOption {
type = listOf (submodule {
options = {
hostname = mkOption {
type = lib.types.str;
example = "snowhawk";
description = ''
nixos configuration hostname
'';
};
system = mkOption {
type = lib.types.str;
default = "x86_64-linux";
example = "aarch64-linux";
description = ''
nixos configuration architecture
'';
};
};
});
};
darwin = mkOption {
type = listOf (submodule {
options = {
hostname = mkOption {
type = lib.types.str;
example = "lynx";
description = ''
nix-darwin configuration hostname
'';
};
system = mkOption {
type = lib.types.str;
default = "aarch64-darwin";
example = "x86_64-darwin";
description = ''
nix-darwin configuration architecture
Note: default is aarch64-darwin not x86_64-darwin
'';
};
};
});
};
home = mkOption {
type = listOf (submodule {
options = {
user = mkOption {
type = lib.types.str;
example = "ravenshade";
description = ''
home-manager configuration architecture
'';
};
system = mkOption {
type = lib.types.str;
default = "x86_64-linux";
example = "aarch64-darwin";
description = ''
home-manager configuration architecture
'';
};
hostname = lib.types.nullOr (mkOption {
type = lib.types.str;
default = "";
example = "permafrost";
description = ''
home-manager configuration hostname
Note: one of `hostname` or `configHostname` must be defined
'';
});
configHostname = lib.types.nullOr (mkOption {
type = lib.types.str;
default = "";
example = "permafrost";
description = ''
home-manager configuration hostname
Note: one of `hostname` or `configHostname` must be defined
'';
});
};
});
};
};
};
};
};
config = { };
}