forked from Fediversity/Fediversity
[HACK] swap out nixops4 deployments for raw nixos modules
rm deployment rm imports
This commit is contained in:
parent
c8882e32f6
commit
228365cdf0
4 changed files with 19 additions and 68 deletions
|
@ -11,7 +11,6 @@ let
|
|||
;
|
||||
inherit (pkgs) lib;
|
||||
inherit (import sources.flake-inputs) import-flake;
|
||||
inputs = (import-flake { src = ./.; }).inputs;
|
||||
inherit ((import-flake { src = ./.; }).inputs) nixops4;
|
||||
panel = import ./panel { inherit sources system; };
|
||||
pre-commit-check =
|
||||
|
@ -79,7 +78,6 @@ in
|
|||
# re-export inputs so they can be overridden granularly
|
||||
# (they can't be accessed from the outside any other way)
|
||||
inherit
|
||||
inputs
|
||||
sources
|
||||
system
|
||||
pkgs
|
||||
|
|
|
@ -7,15 +7,12 @@ 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
|
||||
{
|
||||
_class = "nix-unit";
|
||||
|
@ -133,28 +130,7 @@ in
|
|||
{
|
||||
_class = "fediversity-environment";
|
||||
resources.shell.login-shell.username = "operator";
|
||||
implementation =
|
||||
requests:
|
||||
{ providers, ... }:
|
||||
{
|
||||
_class = "nixops4Deployment";
|
||||
providers = {
|
||||
inherit (inputs.nixops4.modules.nixops4Provider) local;
|
||||
};
|
||||
# this seems checked according to {providers,resources,resource}.nix,
|
||||
# values will not eagerly get checked, matching `providers.nix`'s `lazyAttrsOf`,
|
||||
# whereas allowed keys seem to match those defined in `resource.nix`.
|
||||
# the content of `resources.the-machine` however, follows `nixops4-nixos`,
|
||||
# which is not allowed through our `type` yet.
|
||||
resources.the-machine = {
|
||||
_class = "nixops4Resource";
|
||||
type = providers.local.exec;
|
||||
imports = [
|
||||
inputs.nixops4-nixos.modules.nixops4Resource.nixos
|
||||
];
|
||||
nixos.module =
|
||||
{ ... }:
|
||||
{
|
||||
implementation = requests: {
|
||||
_class = "nixos";
|
||||
users.users = (
|
||||
config.resources.login-shell.policy.apply (
|
||||
|
@ -166,8 +142,7 @@ in
|
|||
) requests
|
||||
)
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -182,10 +157,7 @@ in
|
|||
};
|
||||
};
|
||||
example-deployment = mkOption {
|
||||
type = types.submoduleWith {
|
||||
class = "nixops4Deployment";
|
||||
modules = [ nixops4Deployment ];
|
||||
};
|
||||
type = types.raw;
|
||||
readOnly = true;
|
||||
default = config.environments.single-nixos-vm.deployment config.example-configuration;
|
||||
};
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
@ -13,10 +12,10 @@ let
|
|||
submoduleWith
|
||||
optionType
|
||||
functionTo
|
||||
raw
|
||||
;
|
||||
|
||||
functionType = import ./function.nix;
|
||||
nixops4Deployment = import ./deployment.nix { inherit lib inputs; };
|
||||
|
||||
configuration = mkOption {
|
||||
description = "Configuration type declaring options to be set by operators";
|
||||
|
@ -150,10 +149,7 @@ in
|
|||
};
|
||||
implementation = mkOption {
|
||||
description = "Mapping of resources required by applications to available resources; the result can be deployed";
|
||||
type = functionTo (submoduleWith {
|
||||
class = "nixops4Deployment";
|
||||
modules = [ environment.config.resource-mapping.output-type ];
|
||||
});
|
||||
type = functionTo environment.config.resource-mapping.output-type;
|
||||
};
|
||||
resource-mapping = mkOption {
|
||||
description = "Function type for the mapping from resources to a (NixOps4) deployment";
|
||||
|
@ -164,15 +160,12 @@ in
|
|||
readOnly = true;
|
||||
default = {
|
||||
input-type = configuration;
|
||||
output-type = nixops4Deployment;
|
||||
output-type = raw;
|
||||
};
|
||||
};
|
||||
deployment = mkOption {
|
||||
description = "Generate a deployment from a configuration";
|
||||
type = functionTo (submoduleWith {
|
||||
class = "nixops4Deployment";
|
||||
modules = [ environment.config.resource-mapping.output-type ];
|
||||
});
|
||||
type = functionTo (submodule environment.config.resource-mapping.output-type);
|
||||
readOnly = true;
|
||||
default =
|
||||
cfg:
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
inputs.nixops4.modules.nixops4Deployment.default
|
||||
|
||||
# inherit lib config resources;
|
||||
# # config = {
|
||||
# # type providers provider inputs outputsSkeleton resourceType
|
||||
# # };
|
||||
# }
|
Loading…
Add table
Reference in a new issue