From 7cafee789d6efb7e04b89c1291b119f72373d1af Mon Sep 17 00:00:00 2001 From: David Barroso Date: Mon, 9 Sep 2024 08:11:45 +0200 Subject: [PATCH] feat: override go builder to use overriden go (#20) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### **PR Type** Enhancement ___ ### **Description** - Replaced custom `buildGoNhostModule` with standard `buildGoModule` in `lib/go/go.nix` - Renamed `buildGoNhostModule` to `buildGoModule` in `overlays/go.nix` for consistency - Updated `golangci-lint` configuration to use the new `buildGoModule` function - These changes streamline the Go build process and ensure consistent use of the overridden Go version ___ ### **Changes walkthrough** 📝
Relevant files
Configuration changes
go.nix
Update Go build function                                                                 

lib/go/go.nix - Changed `pkgs.buildGoNhostModule` to `pkgs.buildGoModule`
+1/-1     
Enhancement
go.nix
Refactor Go-related overlays                                                         

overlays/go.nix
  • Renamed buildGoNhostModule to buildGoModule
  • Updated golangci-lint to use prev.final.buildGoModule instead of a
    custom override
  • +2/-2     
    ___ > 💡 **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions --- lib/go/go.nix | 2 +- overlays/go.nix | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/go/go.nix b/lib/go/go.nix index 9c181db..97db683 100644 --- a/lib/go/go.nix +++ b/lib/go/go.nix @@ -92,7 +92,7 @@ in , nativeBuildInputs , cgoEnabled ? 1 , postInstall ? "" - }: (pkgs.buildGoNhostModule { + }: (pkgs.buildGoModule { inherit src version ldflags buildInputs nativeBuildInputs; pname = name; diff --git a/overlays/go.nix b/overlays/go.nix index 2b2e0d8..175cd44 100644 --- a/overlays/go.nix +++ b/overlays/go.nix @@ -10,19 +10,19 @@ final: prev: rec { }); - buildGoNhostModule = prev.buildGoModule.override { go = go; }; + buildGoModule = prev.buildGoModule.override { go = go; }; golangci-lint = prev.golangci-lint.override rec { - buildGoModule = args: prev.buildGoModule.override { go = go; } (args // rec { - version = "1.59.1"; + buildGoModule = args: final.buildGoModule (args // rec { + version = "1.60.3"; src = prev.fetchFromGitHub { owner = "golangci"; repo = "golangci-lint"; rev = "v${version}"; - sha256 = "sha256-VFU/qGyKBMYr0wtHXyaMjS5fXKAHWe99wDZuSyH8opg="; + sha256 = "sha256-0ScdJ5td2N8WF1dwHQ3dBSjyr1kqgrzCfBzbRg9cRrw="; }; - vendorHash = "sha256-yYwYISK1wM/mSlAcDSIwYRo8sRWgw2u+SsvgjH+Z/7M="; + vendorHash = "sha256-ixeswsfx36D0Tg103swbBD8UXXLNYbxSMYDE+JOm+uw="; ldflags = [ "-s"