Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does nixops work? #1554

Open
thkoch2001 opened this issue Apr 5, 2023 · 2 comments
Open

How does nixops work? #1554

thkoch2001 opened this issue Apr 5, 2023 · 2 comments

Comments

@thkoch2001
Copy link

I'm new to nixops and want to understand how it works before investing more time in it. Is there already such Documentation? If so, please make it easier to find! Thanks!

  • What are the steps that happen in the background when Nixops sets up a machine?
  • How does Nixops compare the current vs. the defined state and how does it correct any difference?
  • Is there a way that Nixops would continuously make the above comparison and correction?
  • Is it correct, that Nixops main mode of operation is to build an image (locally) and than deploys it to target machines?
@roberth
Copy link
Member

roberth commented Apr 20, 2023

I'm new to nixops and want to understand how it works before investing more time in it. Is there already such Documentation? If so, please make it easier to find! Thanks!

The documentation has been stripped down since the separation into plugins.

But nonetheless, documentation exists

  • What are the steps that happen in the background when Nixops sets up a machine?

Depends on the chosen backend. If "none", it just expects to be able to ssh into it. Cloud backends will create a VM.

  • How does Nixops compare the current vs. the defined state and how does it correct any difference?

Depends on the backend, but I think there's more to say. This answer should be elaborated on if it isn't already in the docs.

As for the NixOS part of the deployment, it leaves that to NixOS and its activation script.

  • Is there a way that Nixops would continuously make the above comparison and correction?

nixops deploy is idempotent, so you could run it in a loop. This might be useful to recover from some very rare failures. Without a deployment model that takes more of the "environment" into account, such as system load, operating like this isn't super useful.

  • Is it correct, that Nixops main mode of operation is to build an image (locally) and than deploys it to target machines?

If I read this literally, not correct. It generally boots a very basic image, which is then customized by pushing a NixOS system closure to it.
You could work with your own image, but the image is only relevant for first boot.

Maybe by "image" you referred to the system closure? It's the Nix equivalent of an image, but it's rarely if ever serialized into a byte stream like typical images are.

@justinlovinger
Copy link

Most of your questions are better answered by looking into NixOS than NixOps. Long-story-short, NixOps is a tool to push NixOS deployments, while NixOS is a reproducible, declarative, reliable Linux distribution. All the handling of state, dependencies, building, system configuration, etc. are done by NixOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants