diff options
| author | Dan Peebles <pumpkin@me.com> | 2016-08-15 10:27:39 -0400 |
|---|---|---|
| committer | Dan Peebles <pumpkin@me.com> | 2016-08-15 10:46:55 -0400 |
| commit | cfe35e98aa7e6e87bddc0719a3e3c5b7276f7cc2 (patch) | |
| tree | 444192e503b3564e39f8f5a27c85a49e4cbe948f /pkgs/build-support | |
| parent | Remove kde5PackagesFun (diff) | |
| download | nixpkgs-gitlab.intr/fetchurl-user-agent.tar.gz | |
fetchurl: add user agentorigin/fetchurl-user-agentgitlab.intr/fetchurl-user-agent
It would be nice to be able to track Nix requests. It's not trustworthy,
but can be helpful for stats and routing in HTTP logs.
Since `fetchurl` is used so widely, we should "magically" get a UA on
`fetchzip`, `fetchFromGitHub`, and other related fetchers.
Since `fetchurl` is only used for fixed-output derivations, this should
cause no mass rebuild.
Diffstat (limited to 'pkgs/build-support')
| -rw-r--r-- | pkgs/build-support/fetchurl/builder.sh | 1 | ||||
| -rw-r--r-- | pkgs/build-support/fetchurl/default.nix | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/pkgs/build-support/fetchurl/builder.sh b/pkgs/build-support/fetchurl/builder.sh index c4fd18e46caf..ecfdbb5ff1f1 100644 --- a/pkgs/build-support/fetchurl/builder.sh +++ b/pkgs/build-support/fetchurl/builder.sh @@ -13,6 +13,7 @@ curl="curl \ --disable-epsv \ --cookie-jar cookies \ --insecure \ + --user-agent "$userAgent" \ $curlOpts \ $NIX_CURL_FLAGS" diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index a7c76737e1ad..8336eb8bcc30 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -124,6 +124,8 @@ if (!hasHash) then throw "Specify hash for fetchurl fixed-output derivation: ${s inherit curlOpts showURLs mirrorsFile impureEnvVars postFetch downloadToTemp executable; + userAgent = "Nix/${builtins.nixVersion}; nixpkgs/${stdenv.lib.nixpkgsVersion}"; + # Doing the download on a remote machine just duplicates network # traffic, so don't do that. preferLocalBuild = true; |
