Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ just test # Run the unit test suite (auto-runs `go generate` first).
just check # A convenient alias for fmt + lint + test.
```

### 4.2. Pre-commit Hooks
### 4.2. Prek Hooks

This repository uses **pre-commit** to automate quality checks before each commit.
This repository uses **prek** to automate quality checks before each commit.
The hooks are configured in `.pre-commit-config.yaml` to run `just fmt`, `just lint`, and `just test`.
If any of the hooks fail, the commit will not be created.

Expand Down
4 changes: 2 additions & 2 deletions docs/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
**Problem**: Tests failing with "command not found"
- **Solution**: Enter Nix shell with `nix develop` or `direnv allow`. All dev tools are provided by the flake.

**Problem**: Pre-commit hooks not running
- **Solution**: Run `pre-commit install` to install git hooks, then `pre-commit run -a` to test all files.
**Problem**: Prek hooks not running
- **Solution**: Run `prek install` to install git hooks, then `prek run -a` to test all files.
140 changes: 127 additions & 13 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs-25-11.url = "github:NixOS/nixpkgs/nixos-25.11";
go-overlay.url = "github:purpleclay/go-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
nixpkgs-25-11,
go-overlay,
flake-utils,
}:
let
Expand All @@ -19,14 +19,13 @@
else
prev.callPackage ./package.nix { };
};
useLatestGoVersion =
final: prev:
let
nixpkgs = import nixpkgs-25-11 { inherit (prev) system; };
in
{
go_1_26 = nixpkgs.go_1_26;
};
useLatestGoVersion = final: prev: {
go_latest = final.go-bin.latestStable;
# Use buildPackages so the Go toolchain runs on the build platform while
# still cross-compiling for the target (matches nixpkgs' buildGo*Module),
# otherwise cross builds pick the target-arch Go binary and fail to exec.
buildGoLatestModule = prev.buildGoLatestModule.override { go = final.buildPackages.go-bin.latestStable; };
};
Comment thread
tembleking marked this conversation as resolved.
flake = flake-utils.lib.eachDefaultSystem (
system:
let
Expand All @@ -35,6 +34,7 @@
config.allowUnfree = true;
overlays = [
self.overlays.default
go-overlay.overlays.default
useLatestGoVersion
];
};
Expand All @@ -51,19 +51,19 @@
mkShell {
packages = [
ginkgo
go_1_26
go_latest
govulncheck
gofumpt
golangci-lint
just
mockgen
nix-prefetch-docker
pre-commit
prek
skopeo
sd
];
shellHook = ''
pre-commit install
prek install
'';
};

Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ update:
nix develop --command go get -u -t -v ./...
nix develop --command go mod tidy
nix develop --command just rehash-package-nix
nix develop --command pre-commit autoupdate
nix develop --command prek autoupdate
nix develop --command just update-base-images

# Re-calculate the vendorHash from the package.nix
Expand Down
4 changes: 2 additions & 2 deletions package.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ buildGo126Module, versionCheckHook }:
buildGo126Module (finalAttrs: {
{ buildGoLatestModule, versionCheckHook }:
buildGoLatestModule (finalAttrs: {
pname = "sysdig-mcp-server";
version = "3.0.0";
src = ./.;
Expand Down
Loading