buildGoModule with specific go version go_1_17

Hi,

I have an override for the tilt derivation which is a go module and is build with the buildGoModule function:

I use my override to build the latest version of tilt.
Since the version 0.23.7 of tilt it seems to require go 1.17 for the build. How can I specify in my override that the derivation is build with go_1_17 ?

Thanks

override { buildGoModule = buildGo117Module; } or something like that.

Ah I don’t have an override but the following overlay:

nixpkgs.overlays = [
    (self: super: {
      tilt = super.tilt.overrideAttrs (old: rec {
        version = "0.23.9";
        src = super.fetchFromGitHub {
          owner = "tilt-dev";
          repo = "tilt";
          rev = "v${version}";
          #          sha256 = lib.fakeSha256;
          sha256 =
            "sha256:1j5rflc2gmndp1b7rfcdvd5111ipm3vdpf5qpl6ihn2bjwxr84xk";
        };
        ldflags = [ "-X main.version=${version}" ];
      });
    })
  ];

I don’t know how to set the buildGo117Module here

By overriding the overriden derivation.

(foo.override {...}).overrideAttrs (oa: {...})
1 Like

Thanks, defining my overlay as the following worked:

nixpkgs.overlays = [
    (self: super: {
      tilt = (super.tilt.override {
        buildGoModule = pkgs.buildGo117Module;
      }).overrideAttrs (old: rec {
        version = "0.23.9";
        src = super.fetchFromGitHub {
          owner = "tilt-dev";
          repo = "tilt";
          rev = "v${version}";
          #          sha256 = lib.fakeSha256;
          sha256 =
            "sha256:1j5rflc2gmndp1b7rfcdvd5111ipm3vdpf5qpl6ihn2bjwxr84xk";
        };
        ldflags = [ "-X main.version=${version}" ];
      });
    })
  ];