Skip to content

Commit

Permalink
nix: Fix up build output phase to use Go 1.23
Browse files Browse the repository at this point in the history
  • Loading branch information
paulsmith committed Oct 10, 2024
1 parent 23619eb commit a092d41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/golang-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "1.23"
check-latest: true

- name: golangci-lint
Expand Down
11 changes: 8 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,22 @@
};

in {
default = pkgs.buildGoModule rec {
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/go/module.nix
default = pkgs.buildGoModule.override {
go = pkgs.go_1_23;
} rec {
inherit pname version src vendorHash subPackages CGO_ENABLED meta;
};

withGo = pkgs.buildGoModule rec {
withGo = pkgs.buildGoModule.override {
go = pkgs.go_1_23;
} rec {
inherit pname version src vendorHash subPackages CGO_ENABLED meta;
nativeBuildInputs = with pkgs; [ makeWrapper ];
allowGoReference = true;
postInstall = ''
wrapProgram $out/bin/${pname} --prefix PATH : ${
pkgs.lib.makeBinPath (with pkgs; [ go ])
pkgs.lib.makeBinPath (with pkgs; [ go_1_23 ])
}
'';
};
Expand Down

0 comments on commit a092d41

Please sign in to comment.