Giter VIP home page Giter VIP logo

nixops-plugged's Introduction

NixOps 2.0 with batteries included.

Essentially just a wrapper around nixops and some plugins. This flake aims to include any compatible plugins as they become available.

Use from the command line.

Clone this repository and you can run nixops from inside the project root. This flake exports a Nix App, so running nix run . -- <args> is equivalent to running nixops <args>.

Use as a flake input.

You can refer to this flake as input for another flake, i.e. inside the development environment for some flake packaging a NixOps network.

{
  description = "Your awesome flake";

  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  inputs.nixops-plugged.url = "github:lukebfox/nixops-plugged";
  inputs.utils.url = "github:numtide/flake-utils";

  outputs = { self, nixpkgs, nixops-plugged, utils, ... }: {
      nixopsConfigurations.default = { ... }; # your network definition
    } // utils.lib.eachDefaultSystem (system: let
      pkgs = import nixpkgs { inherit system; };
    in {
      devShell = pkgs.mkShell {
        nativeBuildInputs = [ nixops-plugged.defaultPackage.${system} ];
      };
    });
}

While inside the development shell for your flake you will now have access to a fully(ish) featured nixops.

λ nix develop
λ nixops list-plugins

If you only care about one plugin, this flake exports packages for this use case, i.e nixops-plugged.packages.nixops-aws to get a nixops with the nixops-aws plugin.

withPlugins

If you want to mix and match from any supported plugins then use this function

devShell = pkgs.mkShell {
  nativeBuildInputs = [ 
    (nixops-plugged.lib.withPlugins (ps: [ps.nixops-aws ps.nixops-hetznercloud])
  ];
};

Supported plugins (wip)

Plugins Included
AWS ✔️
DigitalOcean ✔️
GCE ✔️
Hetzner Cloud ✔️
VBox ✔️
Hetzner Robot
Proxmox
Virtd

Adding new plugins goes like this:

λ nix develop
λ vim pyproject.toml # add plugin to dependencies
λ vim flake.nix      # add plugin to defaultPackage and/or packages
λ poetry lock

You can run nix run . -- list-plugins to verify your changes.

Use from legacy nix.

The legacy commands nix-build and nix-shell should still work thanks to the compatability shim from flake-compat, although I don't use these so YMMV.

nixops-plugged's People

Contributors

adisbladis avatar lukebfox avatar typetetris avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.