forked from eigengrau/krew2nix
-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
71 lines (71 loc) · 1.93 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
description = "Makes kubectl plug-ins from the Krew repository accessible to Nix";
inputs = {
# keep-sorted start block=yes case=no
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
treefmt-nix = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:numtide/treefmt-nix";
};
# keep-sorted end
};
outputs =
{
self,
flake-utils,
nixpkgs,
treefmt-nix,
systems,
}:
{
overlay = import overlays/.;
}
// flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
overlays = [ self.overlay ];
inherit system;
};
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
environ = {
default.buildInputs = [ pkgs.ruby ];
testing = {
buildInputs =
with pkgs;
[
k9s
kubernetes-helm
(kubectl.withKrewPlugins (
plugins: with plugins; [
# keep-sorted start
change-ns
images
krew
node-shell
# keep-sorted end
]
))
]
++ environ.default.buildInputs;
};
};
in
with pkgs;
{
formatter = treefmtEval.config.build.wrapper;
legacyPackages = self.packages.${system};
packages = {
default = self.packages.${system}.kubectl;
inherit (pkgs) kubectl;
};
devShells = {
ci = pkgs.mkShell { inherit (environ.default) buildInputs; };
default = pkgs.mkShell { inherit (environ.default) buildInputs; };
testing = pkgs.mkShell { inherit (environ.testing) buildInputs; };
};
}
);
}