forked from fediversity/fediversity
Compare commits
No commits in common. "5104ac51c76d411790224319f5e74fb24e7c31fd" and "ed94d17d39cd8f0c114ac25249b72116755619c7" have entirely different histories.
5104ac51c7
...
ed94d17d39
2 changed files with 19 additions and 5 deletions
|
|
@ -7,12 +7,15 @@ let
|
||||||
(lib.evalModules {
|
(lib.evalModules {
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
|
# to be passed to nixops4Deployment
|
||||||
|
resourceProviderSystem = builtins.currentSystem;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
module
|
module
|
||||||
./data-model.nix
|
./data-model.nix
|
||||||
];
|
];
|
||||||
}).config;
|
}).config;
|
||||||
|
nixops4Deployment = import ./deployment.nix { inherit inputs; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
test-eval = {
|
test-eval = {
|
||||||
|
|
@ -168,7 +171,10 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
example-deployment = mkOption {
|
example-deployment = mkOption {
|
||||||
type = types.raw;
|
type = types.submoduleWith {
|
||||||
|
class = "nixops4Deployment";
|
||||||
|
modules = [ nixops4Deployment ];
|
||||||
|
};
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
default = config.environments.single-nixos-vm.deployment config.example-configuration;
|
default = config.environments.single-nixos-vm.deployment config.example-configuration;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
|
inputs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
@ -12,10 +13,11 @@ let
|
||||||
submoduleWith
|
submoduleWith
|
||||||
optionType
|
optionType
|
||||||
functionTo
|
functionTo
|
||||||
raw
|
|
||||||
;
|
;
|
||||||
|
|
||||||
functionType = import ./function.nix;
|
functionType = import ./function.nix;
|
||||||
|
nixops4Deployment = import ./deployment.nix { inherit inputs; };
|
||||||
|
|
||||||
configuration = mkOption {
|
configuration = mkOption {
|
||||||
description = "Configuration type declaring options to be set by operators";
|
description = "Configuration type declaring options to be set by operators";
|
||||||
type = optionType;
|
type = optionType;
|
||||||
|
|
@ -144,7 +146,10 @@ in
|
||||||
};
|
};
|
||||||
implementation = mkOption {
|
implementation = mkOption {
|
||||||
description = "Mapping of resources required by applications to available resources; the result can be deployed";
|
description = "Mapping of resources required by applications to available resources; the result can be deployed";
|
||||||
type = functionTo raw;
|
type = functionTo (submoduleWith {
|
||||||
|
class = "nixops4Deployment";
|
||||||
|
modules = [ environment.config.resource-mapping.output-type ];
|
||||||
|
});
|
||||||
};
|
};
|
||||||
resource-mapping = mkOption {
|
resource-mapping = mkOption {
|
||||||
description = "Function type for the mapping from resources to a (NixOps4) deployment";
|
description = "Function type for the mapping from resources to a (NixOps4) deployment";
|
||||||
|
|
@ -155,12 +160,15 @@ in
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
default = {
|
default = {
|
||||||
input-type = configuration;
|
input-type = configuration;
|
||||||
output-type = raw;
|
output-type = nixops4Deployment;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
deployment = mkOption {
|
deployment = mkOption {
|
||||||
description = "Generate a deployment from a configuration";
|
description = "Generate a deployment from a configuration";
|
||||||
type = functionTo raw;
|
type = functionTo (submoduleWith {
|
||||||
|
class = "nixops4Deployment";
|
||||||
|
modules = [ environment.config.resource-mapping.output-type ];
|
||||||
|
});
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
default =
|
default =
|
||||||
cfg:
|
cfg:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue