treewide: go-modules -> goModules

In 787af0f79f128cb21b113d2eb37e64d913f18aae
I had to change ${go-modules} to $goModules to allow overrideAttrs to work;
However, env vars cannot contain -, so i had to change go-modules too.
This in turn broke nix-update because it uses the go-modules attr.

Instead of making nix-update more complicated, make go-modules naming match cargoDeps.

`fd --type f | xargs sd '\bgo-modules\b' 'goModules'`
and revert change to pkgs/applications/misc/dstask/default.nix
and pkgs/servers/http/dave/default.nix
and pkgs/os-specific/darwin/plistwatch/default.nix

release note added

Artturin 1c29673f 9caab144

+40 -39
+2 -2
doc/languages-frameworks/go.section.md
··· 20 20 21 21 To obtain the actual hash, set `vendorHash = lib.fakeSha256;` and run the build ([more details here](#sec-source-hashes)). 22 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-dependent `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. 23 + - `modPostBuild`: Shell commands to run after the build of the goModules 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. 24 24 25 25 ```nix 26 26 pet = buildGoModule rec { ··· 115 115 116 116 ## Attributes used by the builders {#ssec-go-common-attributes} 117 117 118 - 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: 118 + 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/` goModules fixed output derivation as well: 119 119 120 120 - [`sourceRoot`](#var-stdenv-sourceRoot) 121 121 - [`prePatch`](#var-stdenv-prePatch)
+2
nixos/doc/manual/release-notes/rl-2311.section.md
··· 98 98 99 99 - DocBook option documentation is no longer supported, all module documentation now uses markdown. 100 100 101 + - `buildGoModule` `go-modules` attrs have been renamed to `goModules`. 102 + 101 103 - `services.fail2ban.jails` can now be configured with attribute sets defining settings and filters instead of lines. The stringed options `daemonConfig` and `extraSettings` have respectively been replaced by `daemonSettings` and `jails.DEFAULT.settings` which use attribute sets. 102 104 103 105 - The module [services.ankisyncd](#opt-services.ankisyncd.package) has been switched to [anki-sync-server-rs](https://github.com/ankicommunity/anki-sync-server-rs) from the old python version, which was difficult to update, had not been updated in a while, and did not support recent versions of anki.
+1 -1
pkgs/applications/networking/cluster/k3s/update-script.sh
··· 114 114 EOF 115 115 116 116 set +e 117 - K3S_VENDOR_SHA256=$(nix-prefetch -I nixpkgs=${NIXPKGS_ROOT} "{ sha256 }: (import ${NIXPKGS_ROOT}. {}).k3s_1_${MINOR_VERSION}.go-modules.overrideAttrs (_: { vendorSha256 = sha256; })") 117 + K3S_VENDOR_SHA256=$(nix-prefetch -I nixpkgs=${NIXPKGS_ROOT} "{ sha256 }: (import ${NIXPKGS_ROOT}. {}).k3s_1_${MINOR_VERSION}.goModules.overrideAttrs (_: { vendorSha256 = sha256; })") 118 118 set -e 119 119 120 120 if [ -n "${K3S_VENDOR_SHA256:-}" ]; then
+1 -1
pkgs/applications/networking/cluster/kfctl/default.nix
··· 28 28 homepage = "https://github.com/kubeflow/kfctl"; 29 29 license = licenses.asl20; 30 30 maintainers = with maintainers; [ mvnetbiz ]; 31 - broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.go-modules --check 31 + broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.goModules --check 32 32 }; 33 33 }
+1 -1
pkgs/applications/networking/cluster/kubemqctl/default.nix
··· 21 21 description = "Kubemqctl is a command line interface (CLI) for Kubemq Kubernetes Message Broker."; 22 22 license = lib.licenses.asl20; 23 23 maintainers = with lib.maintainers; [ brianmcgee ]; 24 - broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.go-modules --check 24 + broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.goModules --check 25 25 }; 26 26 }
+1 -1
pkgs/applications/networking/cluster/terraform-providers/update-provider
··· 151 151 old_vendor_hash="$(read_attr vendorHash)" 152 152 if [[ ${old_vendor_hash} != null ]]; then 153 153 echo_provider "calculating vendorHash" 154 - vendorHash=$(generate_hash go-modules) 154 + vendorHash=$(generate_hash goModules) 155 155 update_attr vendorHash "${vendorHash}" 156 156 fi 157 157
+1 -1
pkgs/applications/system/mgmt/default.nix
··· 20 20 hash = "sha256-jurZvEtiaTjWeDkmCJDIFlTzR5EVglfoDxkFgOilo8s="; 21 21 }; 22 22 23 - # patching must be done in prebuild, so it is shared with go-modules 23 + # patching must be done in prebuild, so it is shared with goModules 24 24 # see https://github.com/NixOS/nixpkgs/issues/208036 25 25 preBuild = '' 26 26 for file in `find -name Makefile -type f`; do
+1 -2
pkgs/applications/terminal-emulators/kitty/default.nix
··· 43 43 pname = "kitty-go-modules"; 44 44 inherit src version; 45 45 vendorHash = "sha256-jk2EcYVuhV/UQfHAIfpnn8ZIZnwjA/o8YRXmpoC85Vc="; 46 - }).go-modules; 46 + }).goModules; 47 47 48 48 buildInputs = [ 49 49 harfbuzz ··· 224 224 ''; 225 225 226 226 passthru = { 227 - go-modules = goModules; # allow for updateScript to handle vendorHash 228 227 tests.test = nixosTests.terminal-emulators.kitty; 229 228 updateScript = nix-update-script {}; 230 229 };
+1 -1
pkgs/applications/version-management/forgejo/default.nix
··· 88 88 --prefix PATH : ${lib.makeBinPath [ bash git gzip openssh ]} 89 89 ''; 90 90 91 - # $data is not available in go-modules.drv and preBuild isn't needed 91 + # $data is not available in goModules.drv and preBuild isn't needed 92 92 overrideModAttrs = (_: { 93 93 postPatch = null; 94 94 preBuild = null;
+1 -1
pkgs/applications/version-management/git-hound/default.nix
··· 26 26 homepage = "https://github.com/tillson/git-hound"; 27 27 license = with licenses; [ mit ]; 28 28 maintainers = with maintainers; [ fab ]; 29 - broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.go-modules --check 29 + broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.goModules --check 30 30 }; 31 31 }
+1 -1
pkgs/applications/version-management/sourcehut/fix-gqlgen-trimpath.nix
··· 3 3 }: 4 4 { 5 5 overrideModAttrs = (_: { 6 - # No need to workaround -trimpath: it's not used in go-modules, 6 + # No need to workaround -trimpath: it's not used in goModules, 7 7 # but do download `go generate`'s dependencies nonetheless. 8 8 preBuild = '' 9 9 go generate ./loaders
+1 -1
pkgs/applications/virtualization/singularity/generic.nix
··· 93 93 inherit pname version src; 94 94 95 95 # Override vendorHash with the output got from 96 - # nix-prefetch -E "{ sha256 }: ((import ./. { }).apptainer.override { vendorHash = sha256; }).go-modules" 96 + # nix-prefetch -E "{ sha256 }: ((import ./. { }).apptainer.override { vendorHash = sha256; }).goModules" 97 97 # or with `null` when using vendored source tarball. 98 98 inherit vendorHash deleteVendor proxyVendor; 99 99
+2 -2
pkgs/applications/virtualization/singularity/packages.nix
··· 18 18 }; 19 19 20 20 # Update by running 21 - # nix-prefetch -E "{ sha256 }: ((import ./. { }).apptainer.override { vendorHash = sha256; }).go-modules" 21 + # nix-prefetch -E "{ sha256 }: ((import ./. { }).apptainer.override { vendorHash = sha256; }).goModules" 22 22 # at the root directory of the Nixpkgs repository 23 23 vendorHash = "sha256-PfFubgR/W1WBXIsRO+Kg7hA6ebeAcRiJlTlAZbnl19A="; 24 24 ··· 49 49 }; 50 50 51 51 # Update by running 52 - # nix-prefetch -E "{ sha256 }: ((import ./. { }).singularity.override { vendorHash = sha256; }).go-modules" 52 + # nix-prefetch -E "{ sha256 }: ((import ./. { }).singularity.override { vendorHash = sha256; }).goModules" 53 53 # at the root directory of the Nixpkgs repository 54 54 vendorHash = "sha256-mBhlH6LSmcJuc6HbU/3Q9ii7vJkW9jcikBWCl8oeMOk="; 55 55
+6 -6
pkgs/build-support/go/module.nix
··· 6 6 , passthru ? { } 7 7 , patches ? [ ] 8 8 9 - # A function to override the go-modules derivation 9 + # A function to override the goModules derivation 10 10 , overrideModAttrs ? (_oldAttrs: { }) 11 11 12 12 # path to go.mod and go.sum directory ··· 52 52 let 53 53 args = removeAttrs args' [ "overrideModAttrs" "vendorSha256" "vendorHash" ]; 54 54 55 - go-modules = if (vendorHash == null) then "" else 55 + goModules = if (vendorHash == null) then "" else 56 56 (stdenv.mkDerivation { 57 - name = "${name}-go-modules"; 57 + name = "${name}-goModules"; 58 58 59 59 nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ go git cacert ]; 60 60 ··· 163 163 cd "$modRoot" 164 164 '' + lib.optionalString (vendorHash != null) '' 165 165 ${if proxyVendor then '' 166 - export GOPROXY=file://${go-modules} 166 + export GOPROXY=file://${goModules} 167 167 '' else '' 168 168 rm -rf vendor 169 - cp -r --reflink=auto ${go-modules} vendor 169 + cp -r --reflink=auto ${goModules} vendor 170 170 ''} 171 171 '' + '' 172 172 ··· 288 288 289 289 disallowedReferences = lib.optional (!allowGoReference) go; 290 290 291 - passthru = passthru // { inherit go go-modules vendorHash; } // { inherit (args') vendorSha256; }; 291 + passthru = passthru // { inherit go goModules vendorHash; } // { inherit (args') vendorSha256; }; 292 292 293 293 meta = { 294 294 # Add default meta information
+1 -1
pkgs/development/tools/kcli/default.nix
··· 20 20 homepage = "https://github.com/cswank/kcli"; 21 21 license = licenses.mit; 22 22 maintainers = with maintainers; [ cswank ]; 23 - broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.go-modules --check 23 + broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.goModules --check 24 24 }; 25 25 }
+1 -1
pkgs/servers/authelia/update.sh
··· 80 80 OLD_GO_VENDOR_HASH="$(instantiateClean authelia.vendorHash)" 81 81 echo "Old go vendor hash $OLD_GO_VENDOR_HASH" 82 82 replace "$OLD_GO_VENDOR_HASH" "$TMP_HASH" "$DRV_DIR/sources.nix" 83 - NEW_GO_VENDOR_HASH="$(fetchNewSha authelia.go-modules)" 83 + NEW_GO_VENDOR_HASH="$(fetchNewSha authelia.goModules)" 84 84 echo "New go vendor hash $NEW_GO_VENDOR_HASH" 85 85 replace "$TMP_HASH" "$NEW_GO_VENDOR_HASH" "$DRV_DIR/sources.nix"
+1 -1
pkgs/servers/dns/ncdns/default.nix
··· 37 37 38 38 vendorSha256 = "sha256-ENtTnDsz5WhRz1kiqnWQ5vyEpZtgi7ZeYvksffgW78k="; 39 39 40 - # Override the go-modules fetcher derivation to apply 40 + # Override the goModules fetcher derivation to apply 41 41 # upstream's patch of the crypto/x509 library. 42 42 modBuildPhase = '' 43 43 go mod init github.com/namecoin/x509-compressed
+1 -1
pkgs/servers/geospatial/pg_featureserv/default.nix
··· 20 20 homepage = "https://github.com/CrunchyData/pg_featureserv"; 21 21 license = licenses.asl20; 22 22 maintainers = with maintainers; [ sikmir ]; 23 - broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.go-modules --check 23 + broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.goModules --check 24 24 }; 25 25 }
+1 -1
pkgs/servers/gobetween/default.nix
··· 35 35 homepage = "https://gobetween.io"; 36 36 license = licenses.mit; 37 37 maintainers = with maintainers; [ tomberek ]; 38 - broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.go-modules --check 38 + broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.goModules --check 39 39 }; 40 40 }
+1 -1
pkgs/servers/memos/update.sh
··· 13 13 14 14 extractVendorHash() { 15 15 original="${1?original hash missing}" 16 - result="$(nix-build -A memos.go-modules 2>&1 | tail -n3 | grep 'got:' | cut -d: -f2- | xargs echo || true)" 16 + result="$(nix-build -A memos.goModules 2>&1 | tail -n3 | grep 'got:' | cut -d: -f2- | xargs echo || true)" 17 17 [ -z "$result" ] && { echo "$original"; } || { echo "$result"; } 18 18 } 19 19
+1 -1
pkgs/servers/monitoring/alertmanager-bot/default.nix
··· 30 30 homepage = "https://github.com/metalmatze/alertmanager-bot"; 31 31 license = licenses.mit; 32 32 maintainers = with maintainers; [ mmahut ]; 33 - broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.go-modules --check 33 + broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.goModules --check 34 34 }; 35 35 }
+1 -1
pkgs/servers/monitoring/grafana/update.sh
··· 16 16 } 17 17 extractVendorHash() { 18 18 original="${1?original hash missing}" 19 - result="$(nix-build -A grafana.go-modules 2>&1 | tail -n3 | grep 'got:' | cut -d: -f2- | xargs echo || true)" 19 + result="$(nix-build -A grafana.goModules 2>&1 | tail -n3 | grep 'got:' | cut -d: -f2- | xargs echo || true)" 20 20 [ -z "$result" ] && { echo "$original"; } || { echo "$result"; } 21 21 } 22 22
+3 -3
pkgs/tools/networking/mozillavpn/default.nix
··· 46 46 }) 47 47 ]; 48 48 49 - netfilter-go-modules = (buildGoModule { 49 + netfilter-goModules = (buildGoModule { 50 50 inherit pname version src patches; 51 51 modRoot = "linux/netfilter"; 52 52 vendorHash = "sha256-Cmo0wnl0z5r1paaEf1MhCPbInWeoMhGjnxCxGh0cyO8="; 53 - }).go-modules; 53 + }).goModules; 54 54 55 55 extensionBridgeDeps = rustPlatform.fetchCargoTarball { 56 56 inherit src patches; ··· 132 132 substituteInPlace extension/CMakeLists.txt \ 133 133 --replace '/etc' "$out/etc" 134 134 135 - ln -s '${netfilter-go-modules}' linux/netfilter/vendor 135 + ln -s '${netfilter-goModules}' linux/netfilter/vendor 136 136 137 137 pushd extension/bridge 138 138 cargoDepsCopy="$extensionBridgeDepsCopy" cargoSetupPostPatchHook
+1 -1
pkgs/tools/networking/shadowfox/default.nix
··· 27 27 license = licenses.mit; 28 28 maintainers = with maintainers; [ infinisil ]; 29 29 mainProgram = "shadowfox-updater"; 30 - broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.go-modules --check 30 + broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.goModules --check 31 31 }; 32 32 }
+1 -1
pkgs/tools/networking/waitron/default.nix
··· 34 34 license = licenses.asl20; 35 35 maintainers = with maintainers; [ guibert ]; 36 36 platforms = platforms.linux; 37 - broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.go-modules --check 37 + broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.goModules --check 38 38 }; 39 39 }
+1 -1
pkgs/tools/networking/wuzz/default.nix
··· 18 18 description = "Interactive cli tool for HTTP inspection"; 19 19 license = licenses.agpl3; 20 20 maintainers = with maintainers; [ pradeepchhetri ]; 21 - broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.go-modules --check 21 + broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.goModules --check 22 22 }; 23 23 }
+1 -1
pkgs/tools/security/deepsea/default.nix
··· 26 26 homepage = "https://github.com/dsnezhkov/deepsea"; 27 27 license = with licenses; [ asl20 ]; 28 28 maintainers = with maintainers; [ fab ]; 29 - broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.go-modules --check 29 + broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.goModules --check 30 30 }; 31 31 }
+1 -1
pkgs/tools/security/shhgit/default.nix
··· 22 22 homepage = "https://github.com/eth0izzle/shhgit"; 23 23 license = with licenses; [ mit ]; 24 24 maintainers = with maintainers; [ fab ]; 25 - broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.go-modules --check 25 + broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.goModules --check 26 26 }; 27 27 }
+1 -1
pkgs/tools/security/ssb/default.nix
··· 21 21 homepage = "https://github.com/kitabisa/ssb"; 22 22 license = with licenses; [ asl20 ]; 23 23 maintainers = with maintainers; [ fab ]; 24 - broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.go-modules --check 24 + broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.goModules --check 25 25 }; 26 26 }
+1 -1
pkgs/tools/text/wrap/default.nix
··· 32 32 homepage = "https://github.com/Wraparound/wrap"; 33 33 license = licenses.gpl3Only; 34 34 maintainers = [ maintainers.austinbutler ]; 35 - broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.go-modules --check 35 + broken = true; # vendor isn't reproducible with go > 1.17: nix-build -A $name.goModules --check 36 36 }; 37 37 }