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 {
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
# to be passed to nixops4Deployment
|
||||
resourceProviderSystem = builtins.currentSystem;
|
||||
};
|
||||
modules = [
|
||||
module
|
||||
./data-model.nix
|
||||
];
|
||||
}).config;
|
||||
nixops4Deployment = import ./deployment.nix { inherit inputs; };
|
||||
in
|
||||
{
|
||||
test-eval = {
|
||||
|
|
@ -168,7 +171,10 @@ in
|
|||
};
|
||||
};
|
||||
example-deployment = mkOption {
|
||||
type = types.raw;
|
||||
type = types.submoduleWith {
|
||||
class = "nixops4Deployment";
|
||||
modules = [ nixops4Deployment ];
|
||||
};
|
||||
readOnly = true;
|
||||
default = config.environments.single-nixos-vm.deployment config.example-configuration;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
|
@ -12,10 +13,11 @@ let
|
|||
submoduleWith
|
||||
optionType
|
||||
functionTo
|
||||
raw
|
||||
;
|
||||
|
||||
functionType = import ./function.nix;
|
||||
nixops4Deployment = import ./deployment.nix { inherit inputs; };
|
||||
|
||||
configuration = mkOption {
|
||||
description = "Configuration type declaring options to be set by operators";
|
||||
type = optionType;
|
||||
|
|
@ -144,7 +146,10 @@ in
|
|||
};
|
||||
implementation = mkOption {
|
||||
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 {
|
||||
description = "Function type for the mapping from resources to a (NixOps4) deployment";
|
||||
|
|
@ -155,12 +160,15 @@ in
|
|||
readOnly = true;
|
||||
default = {
|
||||
input-type = configuration;
|
||||
output-type = raw;
|
||||
output-type = nixops4Deployment;
|
||||
};
|
||||
};
|
||||
deployment = mkOption {
|
||||
description = "Generate a deployment from a configuration";
|
||||
type = functionTo raw;
|
||||
type = functionTo (submoduleWith {
|
||||
class = "nixops4Deployment";
|
||||
modules = [ environment.config.resource-mapping.output-type ];
|
||||
});
|
||||
readOnly = true;
|
||||
default =
|
||||
cfg:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue