Make it possible to define modular deployments.#187
Conversation
|
👍 |
|
@edolstra @rbvermaa This needs to wait for NixOS/nixpkgs#2540 for the new flag to be usable, but can you comment on any of the design decisions here before then? Anything blocking a merge once nixpkgs is ready? |
|
Why is the |
|
@rbvermaa insisted this be backwards compatible, I can think of many hacky heuristics but no foolproof way to automatically distinguish between modular and non-modular deployments. |
|
Do you have examples of modular networks somewhere? I seem to remember so but I can't find them. |
|
All of the ones we have contain private info currently, I can scrub one and upload it somewhere but essentially it looks like: |
|
Also in addition to the normal |
With the --modular-expressions flag, nixops will now treat the expressions as a module, with machines and resources being evaluated as submodules. This allows defining deployment-level options/configuration, as well as reducing duplication between eval-machine-info.nix and eval-config.nix. Machines are now defined as attributes in resources.machines, and the network.* configuration are now in the top-level config namespace (so there's an enableRollback option, a description option, etc.). For convenience, the top-level configuration can be accessed as the 'deployment' argument to each module. Depends on NixOS/nixpkgs#2540 (though deployments without the --modular-expressions flag will work without it). Fixes NixOS#78 (see issue for more details on motivation).
|
Closing as this doesn't seem wanted. |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/colmena-yet-another-nixos-deployment-tool/11506/22 |
With the --modular-expressions flag, nixops will now treat the
expressions as a module, with machines and resources being evaluated as
submodules. This allows defining deployment-level options/configuration,
as well as reducing duplication between eval-machine-info.nix and
eval-config.nix.
Machines are now defined as attributes in resources.machines, and the
network.* configuration are now in the top-level config namespace (so
there's an enableRollback option, a description option, etc.). For
convenience, the top-level configuration can be accessed as the
'deployment' argument to each module.
Depends on NixOS/nixpkgs#2540 (though deployments without the
--modular-expressions flag will work without it).
Fixes #78 (see issue for more details on motivation).