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

[WIP] Flake support #1202

wants to merge 16 commits into from

[WIP] Flake support #1202

wants to merge 16 commits into from


Copy link

edolstra commented Oct 4, 2019

This PR adds flake support to NixOps, meaning that you can do things like

# nixops create -d hydra-ec2-demo --flake github:edolstra/hydra-ec2-demo
# nixops deploy

This will create an EC2 instance running Hydra, using exactly the configuration locked by flake.lock.

Currently evaluation is not as hermetic as we'd like since the NixOps-specific NixOS modules are provided impurely. Ideally, the flake would lock a particular version of the NixOps flake as input.

Likewise, NixOps needs to pass in the generated file physical.nix as an impure input. This is something of an inherent issue with the NixOps model. Maybe for flakes in local Git repositories, physical.nix could be auto-committed.

This PR also converts release.nix etc. to flake.nix. update-all (the script for fetching NixOps plugins) is no longer needed since nix flake update can do the same.

edolstra added 2 commits Sep 26, 2019
Example usage:

  $ nixops create -d hydra-ec2-demo --flake github:edolstra/hydra-ec2-demo
  $ nixops deploy

to get an EC2 instance running Hydra.

Evaluation currently doesn't use pure mode because we need access to
NixOps's NixOS modules, and to physical.nix.
@edolstra edolstra added the feature label Oct 4, 2019
@edolstra edolstra force-pushed the flake-support branch from 278c824 to 893ea3f Mar 13, 2020
Copy link

grahamc commented Mar 26, 2020


Thank you for this PR.

In the past several months, some major changes have taken place in

  1. Backends have been removed, preferring a plugin-based architecture.
    Here are some of them:

  2. NixOps Core has been updated to be Python 3 only, and at the
    same time, MyPy type hints have been added and are now strictly
    required during CI.

This is all accumulating in to what I hope will be a NixOps 2.0
. There is a tracking issue for that:
#1242 . It is possible that
more core changes will be made to NixOps for this release, with a
focus on simplifying NixOps core and making it easier to use and work

My hope is that by adding types and more thorough automated testing,
it will be easier for contributors to make improvements, and for
contributions like this one to merge in the future.

However, because of the major changes, it has become likely that this
PR cannot merge right now as it is. The backlog of now-unmergable PRs
makes it hard to see which ones are being kept up to date.

If you would like to see this merge, please bring it up to date with
master and reopen it
. If the or mypy type checking fails, please
correct any issues and then reopen it. I will be looking primarily at
open PRs whose tests are all green.

Thank you again for the work you've done here, I am sorry to be
closing it now.


@grahamc grahamc closed this Mar 26, 2020
edolstra added 4 commits Mar 28, 2020
Flake input changes:

* Updated 'nixpkgs': 'github:edolstra/nixpkgs/44603b4103dbce2c9c18e6cc0df51a74f5eb8975' -> 'github:edolstra/nixpkgs/54a27fb2fc5fbd8927f9f6dc77fe1de1faa05266'
Flake input changes:

* Updated 'nixops-aws': 'github:NixOS/nixops-aws/0da38bb5de82d7a118ac32ebefa7a2d5869ba5ab' -> 'github:NixOS/nixops-aws/af97c16f179cd0df94a6fc3ef470092122253f60'
* Updated 'nixops-hetzner': 'github:NixOS/nixops-hetzner/33256100466e9624af21312d2ae0da8b0b80354a' -> 'github:NixOS/nixops-hetzner/663b02618ece7a92a72da408a552528ee8dd354c'
This can cause the package to depend on two different versions of
Nixpkgs, leading to Python module clashes.
@grahamc grahamc reopened this May 9, 2020
@edolstra edolstra mentioned this pull request Jun 10, 2020
@adisbladis adisbladis mentioned this pull request Jun 11, 2020
Copy link

adisbladis commented Jun 11, 2020

Superseded by #1365 which is based on latest master.

@adisbladis adisbladis closed this Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.