···2021 To obtain the actual hash, set `vendorHash = lib.fakeSha256;` and run the build ([more details here](#sec-source-hashes)).
22- `proxyVendor`: Fetches (go mod download) and proxies the vendor directory. This is useful if your code depends on c code and go mod tidy does not include the needed sources to build or if any dependency has case-insensitive conflicts which will produce platform dependant `vendorHash` checksums.
02324```nix
25pet = buildGoModule rec {
···114115## Attributes used by the builders {#ssec-go-common-attributes}
116117-Both `buildGoModule` and `buildGoPackage` can be tweaked to behave slightly differently, if the following attributes are used:
000000000118119### `ldflags` {#var-go-ldflags}
120
···2021 To obtain the actual hash, set `vendorHash = lib.fakeSha256;` and run the build ([more details here](#sec-source-hashes)).
22- `proxyVendor`: Fetches (go mod download) and proxies the vendor directory. This is useful if your code depends on c code and go mod tidy does not include the needed sources to build or if any dependency has case-insensitive conflicts which will produce platform dependant `vendorHash` checksums.
23+- `modPostBuild`: Shell commands to run after the build of the go-modules executes `go mod vendor`, and before calculating fixed output derivation's `vendorHash` (or `vendorSha256`). Note that if you change this attribute, you need to update `vendorHash` (or `vendorSha256`) attribute.
2425```nix
26pet = buildGoModule rec {
···115116## Attributes used by the builders {#ssec-go-common-attributes}
117118+Many attributes [controlling the build phase](#variables-controlling-the-build-phase) are respected by both `buildGoModule` and `buildGoPackage`. Note that `buildGoModule` reads the following attributes also when building the `vendor/` go-modules fixed output derivation as well:
119+120+- [`sourceRoot`](#var-stdenv-sourceRoot)
121+- [`prePatch`](#var-stdenv-prePatch)
122+- [`patches`](#var-stdenv-patches)
123+- [`patchFlags`](#var-stdenv-patchFlags)
124+- [`postPatch`](#var-stdenv-postPatch)
125+- [`preBuild`](#var-stdenv-preBuild)
126+127+In addition to the above attributes, and the many more variables respected also by `stdenv.mkDerivation`, both `buildGoModule` and `buildGoPackage` respect Go-specific attributes that tweak them to behave slightly differently:
128129### `ldflags` {#var-go-ldflags}
130
···83 inherit (args) src;
84 inherit (go) GOOS GOARCH;
85000086 prePatch = args.prePatch or "";
87 patches = args.patches or [];
88 patchFlags = args.patchFlags or [];
89 postPatch = args.postPatch or "";
90 preBuild = args.preBuild or "";
91- postBuild = args.postBuild or "";
92 sourceRoot = args.sourceRoot or "";
9394 GO111MODULE = "on";
···83 inherit (args) src;
84 inherit (go) GOOS GOARCH;
8586+ # The following inheritence behavior is not trivial to expect, and some may
87+ # argue it's not ideal. Changing it may break vendor hashes in Nixpkgs and
88+ # out in the wild. In anycase, it's documented in:
89+ # doc/languages-frameworks/go.section.md
90 prePatch = args.prePatch or "";
91 patches = args.patches or [];
92 patchFlags = args.patchFlags or [];
93 postPatch = args.postPatch or "";
94 preBuild = args.preBuild or "";
95+ postBuild = args.modPostBuild or "";
96 sourceRoot = args.sourceRoot or "";
9798 GO111MODULE = "on";
···1{ lib, fetchFromGitHub, rustPlatform }:
2rustPlatform.buildRustPackage rec {
3 pname = "tagref";
4- version = "1.6.0";
56 src = fetchFromGitHub {
7 owner = "stepchowfun";
8 repo = pname;
9 rev = "v${version}";
10- sha256 = "sha256-tAkRTHstXoGrSDX5h7xOpHHDOdCqdYu3AXoda84ha4g=";
11 };
1213- cargoHash = "sha256-3pD4hocvnfQziGtDvgc4QxnCEHlmsCFK32PI1zEh9z0=";
1415 meta = with lib; {
16 description = "Tagref helps you refer to other locations in your codebase.";
···1{ lib, fetchFromGitHub, rustPlatform }:
2rustPlatform.buildRustPackage rec {
3 pname = "tagref";
4+ version = "1.7.0";
56 src = fetchFromGitHub {
7 owner = "stepchowfun";
8 repo = pname;
9 rev = "v${version}";
10+ sha256 = "sha256-ESImTR3CFe6ABCP7JHU7XQYvc2VsDN03lkVaKK9MUEU=";
11 };
1213+ cargoHash = "sha256-vqRVD5RW0j2bMF/Zl+Ldc06zyDlzRpADWqxtkvKtydE=";
1415 meta = with lib; {
16 description = "Tagref helps you refer to other locations in your codebase.";
+2-2
pkgs/tools/package-management/nix/default.nix
···69 patches = (args.patches or [ ]) ++ [ ./patches/aws-sdk-cpp-TransferManager-ContentEncoding.patch ];
7071 # only a stripped down version is build which takes a lot less resources to build
72- requiredSystemFeatures = null;
73 });
7475 aws-sdk-cpp-nix = (aws-sdk-cpp.override {
···77 customMemoryManagement = false;
78 }).overrideAttrs (args: {
79 # only a stripped down version is build which takes a lot less resources to build
80- requiredSystemFeatures = null;
81 });
8283
···69 patches = (args.patches or [ ]) ++ [ ./patches/aws-sdk-cpp-TransferManager-ContentEncoding.patch ];
7071 # only a stripped down version is build which takes a lot less resources to build
72+ requiredSystemFeatures = [ ];
73 });
7475 aws-sdk-cpp-nix = (aws-sdk-cpp.override {
···77 customMemoryManagement = false;
78 }).overrideAttrs (args: {
79 # only a stripped down version is build which takes a lot less resources to build
80+ requiredSystemFeatures = [ ];
81 });
8283