This repository has been archived by the owner on Jan 12, 2023. It is now read-only.
forked from typetetris/nixops-with-plugins
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathflake.nix
56 lines (45 loc) · 1.84 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
description = "NixOps with batteries included.";
inputs = {
nixpkgs = { url = "github:nixos/nixpkgs/nixpkgs-unstable"; };
poetry2nix = { url = "github:nix-community/poetry2nix"; };
flake-utils = { url = "github:numtide/flake-utils"; };
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
};
outputs = { self, nixpkgs, poetry2nix, flake-utils, flake-compat, ... }:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs { inherit system; overlays = [poetry2nix.overlay]; };
nixopsPluggable = import ./nixops-pluggable.nix pkgs;
inherit (nixopsPluggable) overrides nixops;
in rec {
defaultApp = { type = "app"; program = "${packages.nixops-plugged}/bin/nixops"; };
defaultPackage = packages.nixops-plugged;
packages = {
# A nixops with all plugins included.
nixops-plugged = nixops.withPlugins (ps: [
ps.nixops-aws
ps.nixops-gcp
ps.nixops-digitalocean
ps.nixops-hetznercloud
ps.nixopsvbox
]);
# A nixops with each plugin for users who use a single provider.
# Benefits from a much faster download/install.
nixops-aws = nixops.withPlugins (ps: [ps.nixops-aws]);
nixops-gcp = nixops.withPlugins (ps: [ps.nixops-gcp]);
nixops-digitalocean = nixops.withPlugins (ps: [ps.nixops-digitalocean]);
nixops-hetznercloud = nixops.withPlugins (ps: [ps.nixops-hetznercloud]);
nixopsvbox = nixops.withPlugins (ps: [ps.nixopsvbox]);
};
lib.withPlugins = nixops.withPlugins;
devShell = pkgs.mkShell {
buildInputs = [
pkgs.poetry
(pkgs.poetry2nix.mkPoetryEnv {
inherit overrides;
projectDir = ./.;
})
];
};
});
}