WIP: builders flake module
This commit is contained in:
parent
1bcf87a248
commit
5e550368b1
3 changed files with 137 additions and 0 deletions
|
@ -30,6 +30,8 @@
|
|||
|
||||
outputs = inputs@{ flake-parts, deploy-rs, nixpkgs, self, ... }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
# imports = [ ./flakeModules/builders.nix ];
|
||||
#
|
||||
flake =
|
||||
let builders = import ./builders.nix inputs;
|
||||
in {
|
||||
|
|
135
flakeModules/builders/default.nix
Normal file
135
flakeModules/builders/default.nix
Normal file
|
@ -0,0 +1,135 @@
|
|||
{ 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 = { };
|
||||
}
|
Loading…
Reference in a new issue