summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-03-11 16:25:34 +0100
committerGitHub <noreply@github.com>2022-03-11 16:25:34 +0100
commit5416f2ecd5308e5a74b6bbcfc83f953a1ef61ca6 (patch)
treece28d6f48ef27db008b0584c39a09d5e78b4f14b /pkgs
parent68c6f3a1b4f4add92fdae3e77dbbc51345b7900f (diff)
parentd78640533693167f9d4af1fa50ee9273d3a4e9e2 (diff)
downloadnixpkgs-5416f2ecd5308e5a74b6bbcfc83f953a1ef61ca6.tar
nixpkgs-5416f2ecd5308e5a74b6bbcfc83f953a1ef61ca6.tar.gz
nixpkgs-5416f2ecd5308e5a74b6bbcfc83f953a1ef61ca6.tar.bz2
nixpkgs-5416f2ecd5308e5a74b6bbcfc83f953a1ef61ca6.tar.lz
nixpkgs-5416f2ecd5308e5a74b6bbcfc83f953a1ef61ca6.tar.xz
nixpkgs-5416f2ecd5308e5a74b6bbcfc83f953a1ef61ca6.tar.zst
nixpkgs-5416f2ecd5308e5a74b6bbcfc83f953a1ef61ca6.zip
Merge pull request #162771 from IvarWithoutBones/dotnet-setuphook
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/build-support/dotnet/build-dotnet-module/default.nix3
-rw-r--r--pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-configure-hook.sh2
-rw-r--r--pkgs/development/compilers/dotnet/build-dotnet.nix9
-rw-r--r--pkgs/development/tools/continuous-integration/github-runner/default.nix5
-rw-r--r--pkgs/development/tools/misc/netcoredbg/default.nix9
-rw-r--r--pkgs/servers/jellyfin/default.nix5
-rw-r--r--pkgs/servers/nosql/eventstore/default.nix4
7 files changed, 10 insertions, 27 deletions
diff --git a/pkgs/build-support/dotnet/build-dotnet-module/default.nix b/pkgs/build-support/dotnet/build-dotnet-module/default.nix
index e3762327a10..b5651d72a92 100644
--- a/pkgs/build-support/dotnet/build-dotnet-module/default.nix
+++ b/pkgs/build-support/dotnet/build-dotnet-module/default.nix
@@ -102,9 +102,6 @@ in stdenvNoCC.mkDerivation (args // {
   # gappsWrapperArgs gets included when wrapping for dotnet, as to avoid double wrapping
   dontWrapGApps = args.dontWrapGApps or true;
 
-  DOTNET_NOLOGO = args.DOTNET_NOLOGO or true; # This disables the welcome message.
-  DOTNET_CLI_TELEMETRY_OPTOUT = args.DOTNET_CLI_TELEMETRY_OPTOUT or true;
-
   passthru = {
     fetch-deps = writeScript "fetch-${pname}-deps" ''
       set -euo pipefail
diff --git a/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-configure-hook.sh b/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-configure-hook.sh
index 3ca89fdc095..59daacbac0e 100644
--- a/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-configure-hook.sh
+++ b/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-configure-hook.sh
@@ -9,8 +9,6 @@ dotnetConfigureHook() {
         parallelFlag="--disable-parallel"
     fi
 
-    export HOME=$(mktemp -d)
-
     for project in ${projectFile[@]} ${testProjectFile[@]}; do
         env \
             dotnet restore "$project" \
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;
diff --git a/pkgs/development/tools/continuous-integration/github-runner/default.nix b/pkgs/development/tools/continuous-integration/github-runner/default.nix
index 7818f7464ba..222ffb0688f 100644
--- a/pkgs/development/tools/continuous-integration/github-runner/default.nix
+++ b/pkgs/development/tools/continuous-integration/github-runner/default.nix
@@ -102,11 +102,6 @@ stdenv.mkDerivation rec {
   configurePhase = ''
     runHook preConfigure
 
-    # Set up Nuget dependencies
-    export HOME=$(mktemp -d)
-    export DOTNET_CLI_TELEMETRY_OPTOUT=1
-    export DOTNET_NOLOGO=1
-
     # Never use nuget.org
     nuget sources Disable -Name "nuget.org"
 
diff --git a/pkgs/development/tools/misc/netcoredbg/default.nix b/pkgs/development/tools/misc/netcoredbg/default.nix
index 1907eb8b363..cb0c1cdc8ec 100644
--- a/pkgs/development/tools/misc/netcoredbg/default.nix
+++ b/pkgs/development/tools/misc/netcoredbg/default.nix
@@ -24,14 +24,7 @@ let
   unmanaged = clangStdenv.mkDerivation rec {
     inherit src pname version;
 
-    nativeBuildInputs = [ cmake ];
-
-    # Building the "unmanaged part" still involves compiling C# code.
-    preBuild = ''
-      export HOME=$(mktemp -d)
-      export DOTNET_CLI_TELEMETRY_OPTOUT=1
-      export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
-    '';
+    nativeBuildInputs = [ cmake dotnet-sdk ];
 
     hardeningDisable = [ "strictoverflow" ];
 
diff --git a/pkgs/servers/jellyfin/default.nix b/pkgs/servers/jellyfin/default.nix
index 4dce2a7258f..814d8eecdc3 100644
--- a/pkgs/servers/jellyfin/default.nix
+++ b/pkgs/servers/jellyfin/default.nix
@@ -70,11 +70,6 @@ stdenv.mkDerivation rec {
   configurePhase = ''
     runHook preConfigure
 
-    export HOME=$(mktemp -d)
-
-    export DOTNET_CLI_TELEMETRY_OPTOUT=1
-    export DOTNET_NOLOGO=1
-
     nuget sources Add -Name nixos -Source "$PWD/nixos"
     nuget init "$nugetDeps" "$PWD/nixos"
 
diff --git a/pkgs/servers/nosql/eventstore/default.nix b/pkgs/servers/nosql/eventstore/default.nix
index 769c45ffc6c..035d906b2bd 100644
--- a/pkgs/servers/nosql/eventstore/default.nix
+++ b/pkgs/servers/nosql/eventstore/default.nix
@@ -43,10 +43,6 @@ stdenv.mkDerivation rec {
   '';
 
   buildPhase = ''
-    mkdir home
-    export HOME=$PWD/home
-    export DOTNET_CLI_TELEMETRY_OPTOUT=1
-    export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
     export FrameworkPathOverride=${mono}/lib/mono/4.7.1-api
 
     # disable default-source so nuget does not try to download from online-repo