about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorStefano Mazzucco <stefano@curso.re>2020-02-11 20:38:15 +0000
committerStefano Mazzucco <stefano@curso.re>2020-02-11 20:44:04 +0000
commit2b4794f941ceb73cad80758fc8f34fa8281aa511 (patch)
tree18ebe5a69c6c9109f83d1d980fee7937c949d8bf /pkgs
parentc6b1ce47b673a35c140e7eec8b7409c645443a6f (diff)
downloadnixlib-2b4794f941ceb73cad80758fc8f34fa8281aa511.tar
nixlib-2b4794f941ceb73cad80758fc8f34fa8281aa511.tar.gz
nixlib-2b4794f941ceb73cad80758fc8f34fa8281aa511.tar.bz2
nixlib-2b4794f941ceb73cad80758fc8f34fa8281aa511.tar.lz
nixlib-2b4794f941ceb73cad80758fc8f34fa8281aa511.tar.xz
nixlib-2b4794f941ceb73cad80758fc8f34fa8281aa511.tar.zst
nixlib-2b4794f941ceb73cad80758fc8f34fa8281aa511.zip
aws-sam-cli: add argument to conditionally enable telemetry
If someone really wants to opt into telemetry, they can do so by setting
`enableTelemetry` to `true` (the default is `false`), in which case the wrapper
that sets `SAM_CLI_TELEMETRY` to `0` will not be created.

Note that this actually allows a user to optionally disable telemetry from the
command line or the (poorly documented) configuration in
`~/.aws-sam/metadata.json`. The downside is telemetry will be enabled at least
on the first run, causing a unique installation ID to be saved in the
configuration file.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/tools/aws-sam-cli/default.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/development/tools/aws-sam-cli/default.nix b/pkgs/development/tools/aws-sam-cli/default.nix
index 916ff325b43b..09a61ef564f6 100644
--- a/pkgs/development/tools/aws-sam-cli/default.nix
+++ b/pkgs/development/tools/aws-sam-cli/default.nix
@@ -1,5 +1,6 @@
 { lib
 , python
+, enableTelemetry ? false
 }:
 
 let
@@ -83,7 +84,7 @@ buildPythonApplication rec {
     tomlkit
   ];
 
-  postFixup = ''
+  postFixup = if enableTelemetry then "echo aws-sam-cli TELEMETRY IS ENABLED" else ''
     # Disable telemetry: https://github.com/awslabs/aws-sam-cli/issues/1272
     wrapProgram $out/bin/sam --set  SAM_CLI_TELEMETRY 0
   '';