-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mark Sagi-Kazar <[email protected]>
- Loading branch information
1 parent
807703e
commit 16f15bb
Showing
4 changed files
with
325 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8=" | ||
fi | ||
use flake . --impure | ||
|
||
# Kubernetes | ||
export KUBECONFIG=$DEVENV_STATE/kube/config | ||
export KIND_CLUSTER_NAME=vault-operator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
dist/ | ||
.idea | ||
/.devenv/ | ||
/.direnv/ | ||
/dist/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
description = "Run main.go in Kubernetes with one command, also port-forward your app into Kubernetes"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
flake-parts.url = "github:hercules-ci/flake-parts"; | ||
devenv.url = "github:cachix/devenv"; | ||
}; | ||
|
||
outputs = inputs@{ flake-parts, ... }: | ||
flake-parts.lib.mkFlake { inherit inputs; } { | ||
imports = [ | ||
inputs.devenv.flakeModule | ||
]; | ||
|
||
systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ]; | ||
|
||
perSystem = { config, self', inputs', pkgs, system, ... }: rec { | ||
devenv.shells = { | ||
default = { | ||
languages = { | ||
go.enable = true; | ||
}; | ||
|
||
packages = with pkgs; [ | ||
gnumake | ||
|
||
golangci-lint | ||
goreleaser | ||
|
||
kind | ||
kubectl | ||
kustomize | ||
]; | ||
|
||
scripts = { | ||
versions.exec = '' | ||
go version | ||
golangci-lint version | ||
echo "goreleaser $(goreleaser --version | sed -n '9p' | cut -d ' ' -f 5)" | ||
kind version | ||
kubectl version --client | ||
echo kustomize $(kustomize version --short) | ||
''; | ||
}; | ||
|
||
enterShell = '' | ||
versions | ||
''; | ||
|
||
# https://github.com/cachix/devenv/issues/528#issuecomment-1556108767 | ||
containers = pkgs.lib.mkForce { }; | ||
}; | ||
|
||
ci = devenv.shells.default; | ||
}; | ||
}; | ||
}; | ||
} |