summary refs log tree commit diff
path: root/pkgs/development/compilers/dotnet/build-dotnet.nix
diff options
context:
space:
mode:
authorIvar Scholten <ivar.scholten@protonmail.com>2022-03-04 14:08:44 +0100
committerIvar Scholten <ivar.scholten@protonmail.com>2022-03-04 14:17:40 +0100
commit8ef298b84f6c2426b62987f0eb31d5b754c990f3 (patch)
treeeefcd1a250cc14bf421fe286e0723609af014bd4 /pkgs/development/compilers/dotnet/build-dotnet.nix
parent550ff4cdac48d7f39db3a063f3cb1680d1600e62 (diff)
downloadnixpkgs-8ef298b84f6c2426b62987f0eb31d5b754c990f3.tar
nixpkgs-8ef298b84f6c2426b62987f0eb31d5b754c990f3.tar.gz
nixpkgs-8ef298b84f6c2426b62987f0eb31d5b754c990f3.tar.bz2
nixpkgs-8ef298b84f6c2426b62987f0eb31d5b754c990f3.tar.lz
nixpkgs-8ef298b84f6c2426b62987f0eb31d5b754c990f3.tar.xz
nixpkgs-8ef298b84f6c2426b62987f0eb31d5b754c990f3.tar.zst
nixpkgs-8ef298b84f6c2426b62987f0eb31d5b754c990f3.zip
dotnet: add setup hook to set required env vars
Diffstat (limited to 'pkgs/development/compilers/dotnet/build-dotnet.nix')
-rw-r--r--pkgs/development/compilers/dotnet/build-dotnet.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/development/compilers/dotnet/build-dotnet.nix b/pkgs/development/compilers/dotnet/build-dotnet.nix
index 21cc6c8227c..55deb594706 100644
--- a/pkgs/development/compilers/dotnet/build-dotnet.nix
+++ b/pkgs/development/compilers/dotnet/build-dotnet.nix
@@ -4,9 +4,11 @@
 }:
 
 assert builtins.elem type [ "aspnetcore" "runtime" "sdk"];
+
 { lib
 , stdenv
 , fetchurl
+, writeText
 , libunwind
 , openssl
 , icu
@@ -87,6 +89,13 @@ in stdenv.mkDerivation rec {
     $out/bin/dotnet --info
   '';
 
+  setupHook = writeText "dotnet-setup-hook" ''
+    export HOME=$(mktemp -d) # Dotnet expects a writable home directory for its configuration files
+    export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 # Dont try to expand NuGetFallbackFolder to disk
+    export DOTNET_NOLOGO=1 # Disables the welcome message
+    export DOTNET_CLI_TELEMETRY_OPTOUT=1
+  '';
+
   meta = with lib; {
     homepage = "https://dotnet.github.io/";
     description = builtins.getAttr type descriptions;