From fee929df47f4748903cf5799fe37a2d37d655dba Mon Sep 17 00:00:00 2001 From: Jaculabilis Date: Sat, 12 Feb 2022 11:06:57 -0800 Subject: [PATCH] Disable dotnet telemetry in dev shell --- README.md | 11 ++++++++++- flake.nix | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a5aca8a..cedb502 100644 --- a/README.md +++ b/README.md @@ -65,4 +65,13 @@ rec { ``` $ which dotnet /nix/store/87s452c8wj2zmy21q8q394f6rzf5y1br-dotnet-sdk-6.0.100/bin/dotnet -``` \ No newline at end of file +``` + +So now we have our development tools (well, tool). The `dotnet --help` text tells us a few things about telemetry, so let's define a prompt so we know when we're in the nix shell and then set the telemetry opt-out. + +``` +shellHook = '' + PS1="5dplomacy:\W$ " +''; +DOTNET_CLI_TELEMETRY_OPTOUT = 1; +``` diff --git a/flake.nix b/flake.nix index 2e569ff..85905d5 100644 --- a/flake.nix +++ b/flake.nix @@ -8,6 +8,10 @@ let pkgs = nixpkgs.legacyPackages.${system}; in rec { devShell = pkgs.mkShell { + shellHook = '' + PS1="5dplomacy:\W$ " + ''; + DOTNET_CLI_TELEMETRY_OPTOUT = 1; packages = [ pkgs.dotnet-sdk ]; }; }