Skip to content

Commit eaf1531

Browse files
sylrclaude
andcommitted
chore: sync nix and Justfile improvements from main
- flake.nix: use allowUnfreePredicate instead of allowUnfree, remove goVersion overlay in favor of explicit go_1_24, organize packages into named lists, fix aarch64-linux hash typo - Justfile: reorder pre-commit deps, add golangci-lint version print, add local build tag, add fmt recipe, guard generate-client with SPEAKEASY_API_KEY, fix missing newline at EOF Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 88ba8d6 commit eaf1531

File tree

2 files changed

+39
-34
lines changed

2 files changed

+39
-34
lines changed

Justfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ set dotenv-load
33
default:
44
@just --list
55

6-
pre-commit: tidy generate lint export-docs-events openapi generate-client
6+
pre-commit: tidy generate generate-client lint export-docs-events openapi
77
pc: pre-commit
88

99
lint:
10-
golangci-lint run --fix --build-tags it --timeout 5m
10+
golangci-lint --version
11+
golangci-lint run --fix --build-tags it,local --timeout 5m
1112
for d in $(ls tools); do \
1213
pushd tools/$d; \
1314
golangci-lint run --fix --build-tags it --timeout 5m; \
@@ -41,12 +42,15 @@ tests:
4142
cat coverage.txt | grep -v debug.go | grep -v "/machine/" | grep -v "pb.go" > coverage2.txt
4243
mv coverage2.txt coverage.txt
4344

45+
fmt:
46+
@golangci-lint fmt
47+
4448
openapi:
4549
yq eval-all '. as $item ireduce ({}; . * $item)' openapi/v1.yaml openapi/v2.yaml openapi/overlay.yaml > openapi.yaml
4650
npx -y widdershins {{justfile_directory()}}/openapi/v2.yaml -o {{justfile_directory()}}/docs/api/README.md --search false --language_tabs 'http:HTTP' --summary --omitHeader
4751

4852
generate-client: openapi
49-
@cd pkg/client && speakeasy run --skip-versioning
53+
if [ ! -z "${SPEAKEASY_API_KEY:-}" ]; then cd pkg/client && speakeasy run --skip-versioning; fi
5054

5155
release-local:
5256
@goreleaser release --nightly --skip=publish --clean
@@ -60,4 +64,4 @@ release:
6064
generate-grpc-replication:
6165
protoc --go_out=. --go_opt=paths=source_relative \
6266
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
63-
./internal/replication/grpc/replication_service.proto
67+
./internal/replication/grpc/replication_service.proto

flake.nix

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
outputs = { self, nixpkgs, nur }:
1414
let
15-
goVersion = 24;
16-
1715
supportedSystems = [
1816
"x86_64-linux"
1917
"aarch64-linux"
@@ -26,8 +24,10 @@
2624
let
2725
pkgs = import nixpkgs {
2826
inherit system;
29-
overlays = [ self.overlays.default nur.overlays.default ];
30-
config.allowUnfree = true;
27+
overlays = [ nur.overlays.default ];
28+
config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [
29+
"goreleaser-pro"
30+
];
3131
};
3232
in
3333
f { pkgs = pkgs; system = system; }
@@ -42,17 +42,13 @@
4242
};
4343
speakeasyHashes = {
4444
"x86_64-linux" = "632559a6bdc765ef42b81b8404fd0a3e5023919a0bb70ff7e40a8cc259545afd";
45-
"aarch64-linux" = "c74c502df3a05a2d69e6b282886df23354a319d0510d2c1a21fcc124b7ad00efGOROOT";
45+
"aarch64-linux" = "c74c502df3a05a2d69e6b282886df23354a319d0510d2c1a21fcc124b7ad00ef";
4646
"x86_64-darwin" = "8814be1fdd4eaf6dcc7fb251ede5693e1d3d4c8e03986f8d37bfd59e049698b9";
4747
"aarch64-darwin" = "12c20fa485de4725c9730cb2e8936cab4b0961d0a956e9f4c45534371f2a6148";
4848
};
4949

5050
in
5151
{
52-
overlays.default = final: prev: {
53-
go = final."go_1_${toString goVersion}";
54-
};
55-
5652
packages = forEachSupportedSystem ({ pkgs, system }:
5753
{
5854
speakeasy = pkgs.stdenv.mkDerivation {
@@ -85,30 +81,35 @@
8581
defaultPackage.aarch64-darwin = self.packages.aarch64-darwin.speakeasy;
8682

8783
devShells = forEachSupportedSystem ({ pkgs, system }:
84+
let
85+
stablePackages = with pkgs; [
86+
ginkgo
87+
go_1_24
88+
go-tools
89+
golangci-lint
90+
gomarkdoc
91+
goperf
92+
gotools
93+
jdk11
94+
jq
95+
just
96+
mockgen
97+
nodejs_22
98+
protobuf_27
99+
protoc-gen-go
100+
protoc-gen-go-grpc
101+
yq-go
102+
];
103+
otherPackages = [
104+
pkgs.nur.repos.goreleaser.goreleaser-pro
105+
self.packages.${system}.speakeasy
106+
];
107+
in
88108
{
89109
default = pkgs.mkShell {
90-
packages = with pkgs; [
91-
go
92-
gotools
93-
go-tools
94-
golangci-lint
95-
ginkgo
96-
yq-go
97-
jq
98-
pkgs.nur.repos.goreleaser.goreleaser-pro
99-
mockgen
100-
gomarkdoc
101-
jdk11
102-
just
103-
nodejs_22
104-
self.packages.${system}.speakeasy
105-
goperf
106-
protobuf_27
107-
protoc-gen-go-grpc
108-
protoc-gen-go
109-
];
110+
packages = stablePackages ++ otherPackages;
110111
};
111112
}
112113
);
113114
};
114-
}
115+
}

0 commit comments

Comments
 (0)