-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathflake.nix
More file actions
121 lines (103 loc) · 3.32 KB
/
flake.nix
File metadata and controls
121 lines (103 loc) · 3.32 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
(flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfreePredicate = pkg: pkg.pname == "ngrok";
};
};
readmeGeneratorForHelm = pkgs.buildNpmPackage {
pname = "readme-generator-for-helm";
version = "2.6.1";
src = pkgs.fetchFromGitHub {
owner = "bitnami";
repo = "readme-generator-for-helm";
rev = "2.6.1";
hash = "sha256-hgVSiYOM33MMxVlt36aEc0uBWIG/OS0l7X7ZYNESO6A=";
};
npmDepsHash = "sha256-baRBchp4dBruLg0DoGq7GsgqXkI/mBBDowtAljC2Ckk=";
dontNpmBuild = true;
};
mkScript =
name: text:
let
script = pkgs.writeShellScriptBin name text;
in
script;
scripts = [
(mkScript "devhelp" ''
cat <<'EOF'
Welcome to the ngrok-operator development environment!
Please make sure you have the following environment variables set:
NGROK_API_KEY - Your ngrok API key
NGROK_AUTHTOKEN - Your ngrok authtoken
If you are using GitHub Codespaces, a kind cluster should
already be running. You can verify this by running:
kind get clusters
Common commands:
make build - Build the operator
make test - Run tests
make lint - Run linters
make deploy - Deploy to the kind cluster
For more information, see the development documentation in
./docs/developer-guide/README.md
You can also run "devhelp" at any time to see this message again.
EOF
'')
];
in
{
packages.readme-generator-for-helm = readmeGeneratorForHelm;
devShells.default = pkgs.mkShell {
buildInputs =
with pkgs;
[
bashInteractive
go
go-tools
golangci-lint
gotools
jq
kind
kubebuilder
kubectl
kubernetes-controller-tools
(pkgs.wrapHelm pkgs.kubernetes-helm {
plugins = [
pkgs.kubernetes-helmPlugins.helm-unittest
];
})
kyverno-chainsaw
ngrok
nixfmt-rfc-style
setup-envtest
tilt
yq
readmeGeneratorForHelm
]
++ scripts;
CGO_ENABLED = "0";
# GitHub Codespaces sets GOROOT in /etc/environment. However, we are managing
# go via nix, so we need to unset it to avoid conflicts. See also: https://dave.cheney.net/2013/06/14/you-dont-need-to-set-goroot-really
GOROOT = "";
ENVTEST_K8S_VERSION = "1.34.1";
shellHook = ''
export KUBEBUILDER_ASSETS="$(setup-envtest use $ENVTEST_K8S_VERSION -p path)"
devhelp
'';
};
}
));
}