Skip to content

Commit 16e62a3

Browse files
authored
feat: Codespaces based development environment (#685)
* refactor: Sort and nixfmt the list of nix packages Signed-off-by: Jonathan Stacks <[email protected]> * feat: Add kind and tilt to devenv Signed-off-by: Jonathan Stacks <[email protected]> * feat: Add initial dev container --------- Signed-off-by: Jonathan Stacks <[email protected]>
1 parent bc7ea3d commit 16e62a3

File tree

2 files changed

+46
-19
lines changed

2 files changed

+46
-19
lines changed

.devcontainer/devcontainer.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "ngrok-operator",
3+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04",
4+
"features": {
5+
"ghcr.io/devcontainers/features/nix:1": {
6+
"extraNixConfig": "experimental-features = nix-command flakes,sandbox = true",
7+
"packages": "direnv"
8+
},
9+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
10+
},
11+
"postCreateCommand": "direnv allow && direnv exec . make bootstrap-tools"
12+
}

flake.nix

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,39 @@
44
flake-utils.url = "github:numtide/flake-utils";
55
};
66

7-
outputs = { self, nixpkgs, flake-utils }: (flake-utils.lib.eachDefaultSystem (system:
8-
let
9-
pkgs = nixpkgs.legacyPackages.${system};
10-
in
7+
outputs =
118
{
12-
devShells.default = pkgs.mkShell {
13-
buildInputs = with pkgs; [
14-
go_1_24
15-
gotools
16-
go-tools
17-
golangci-lint
18-
kubernetes-helm
19-
kubebuilder
20-
jq
21-
yq
22-
kyverno-chainsaw
23-
];
24-
CGO_ENABLED = "0";
25-
};
26-
}));
9+
self,
10+
nixpkgs,
11+
flake-utils,
12+
}:
13+
(flake-utils.lib.eachDefaultSystem (
14+
system:
15+
let
16+
pkgs = nixpkgs.legacyPackages.${system};
17+
in
18+
{
19+
devShells.default = pkgs.mkShell {
20+
buildInputs = with pkgs; [
21+
go_1_24
22+
go-tools
23+
golangci-lint
24+
gotools
25+
jq
26+
kind
27+
kubebuilder
28+
kubernetes-helm
29+
kyverno-chainsaw
30+
nixfmt-rfc-style
31+
tilt
32+
yq
33+
];
34+
35+
CGO_ENABLED = "0";
36+
# GitHub Codespaces sets GOROOT in /etc/environment. However, we are managing
37+
# 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
38+
GOROOT = "";
39+
};
40+
}
41+
));
2742
}

0 commit comments

Comments
 (0)