From 33485a049719213b154eefbe4382f5911f5335f8 Mon Sep 17 00:00:00 2001 From: Graham McIntie Date: Sun, 15 Feb 2026 08:58:13 -0600 Subject: [PATCH] dev: add gopls/delve to flake, add Makefile for proto/test/build --- Makefile | 20 ++++++++++++++++++++ flake.nix | 9 +++++++++ 2 files changed, 29 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..58d4ba2 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +.PHONY: proto test build vet lint + +proto: + protoc --go_out=. --go_opt=paths=source_relative proto/agent.proto + @# protoc outputs to proto/ due to go_package; move to pb/ + mv proto/agent.pb.go pb/agent.pb.go + +test: + go test -race -v ./... + +build: + go build -o towerops-agent . + +vet: + go vet ./... + +lint: + golangci-lint run + +all: proto vet test build diff --git a/flake.nix b/flake.nix index 5c81a38..cf8b3ba 100644 --- a/flake.nix +++ b/flake.nix @@ -19,11 +19,20 @@ pkgs.protobuf pkgs.protoc-gen-go pkgs.git + pkgs.gopls + pkgs.delve ]; env = { PROTOC = "${pkgs.protobuf}/bin/protoc"; }; + + shellHook = '' + echo "towerops-agent dev shell" + echo " go test ./... - run tests" + echo " go build ./... - build" + echo " make proto - regenerate protobuf" + ''; }; }); }