Merge pull request #162771 from IvarWithoutBones/dotnet-setuphook
commit5416f2ecd5308e5a74b6bbcfc83f953a1ef61ca6
authorSandro <sandro.jaeckel@gmail.com>
dateFri 11 Mar 2022, 16:25 (5 years ago)
parent68c6f3ad786405
pkgs/build-support/dotnet/build-dotnet-module/default.nix−3
@@ -102,9 +102,6 @@ in stdenvNoCC.mkDerivation (args // {
102102 # gappsWrapperArgs gets included when wrapping for dotnet, as to avoid double wrapping
103103 dontWrapGApps = args.dontWrapGApps or true;
104104
105− DOTNET_NOLOGO = args.DOTNET_NOLOGO or true; # This disables the welcome message.
106− DOTNET_CLI_TELEMETRY_OPTOUT = args.DOTNET_CLI_TELEMETRY_OPTOUT or true;
107−
108105 passthru = {
109106 fetch-deps = writeScript "fetch-${pname}-deps" ''
110107 set -euo pipefail
pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-configure-hook.sh−2
@@ -9,8 +9,6 @@ dotnetConfigureHook() {
99 parallelFlag="--disable-parallel"
1010 fi
1111
12− export HOME=$(mktemp -d)
13−
1412 for project in ${projectFile[@]} ${testProjectFile[@]}; do
1513 env \
1614 dotnet restore "$project" \
pkgs/development/compilers/dotnet/build-dotnet.nix+9
@@ -4,9 +4,11 @@
44}:
55
66assert builtins.elem type [ "aspnetcore" "runtime" "sdk"];
7+
78{ lib
89, stdenv
910, fetchurl
11+, writeText
1012, libunwind
1113, openssl
1214, icu
@@ -87,6 +89,13 @@ in stdenv.mkDerivation rec {
8789 $out/bin/dotnet --info
8890 '';
8991
92+ setupHook = writeText "dotnet-setup-hook" ''
93+ export HOME=$(mktemp -d) # Dotnet expects a writable home directory for its configuration files
94+ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 # Dont try to expand NuGetFallbackFolder to disk
95+ export DOTNET_NOLOGO=1 # Disables the welcome message
96+ export DOTNET_CLI_TELEMETRY_OPTOUT=1
97+ '';
98+
9099 meta = with lib; {
91100 homepage = "https://dotnet.github.io/";
92101 description = builtins.getAttr type descriptions;
pkgs/development/tools/continuous-integration/github-runner/default.nix−5
@@ -102,11 +102,6 @@ stdenv.mkDerivation rec {
102102 configurePhase = ''
103103 runHook preConfigure
104104
105− # Set up Nuget dependencies
106− export HOME=$(mktemp -d)
107− export DOTNET_CLI_TELEMETRY_OPTOUT=1
108− export DOTNET_NOLOGO=1
109−
110105 # Never use nuget.org
111106 nuget sources Disable -Name "nuget.org"
112107
pkgs/development/tools/misc/netcoredbg/default.nix+1−8
@@ -24,14 +24,7 @@ let
2424 unmanaged = clangStdenv.mkDerivation rec {
2525 inherit src pname version;
2626
27− nativeBuildInputs = [ cmake ];
28−
29− # Building the "unmanaged part" still involves compiling C# code.
30− preBuild = ''
31− export HOME=$(mktemp -d)
32− export DOTNET_CLI_TELEMETRY_OPTOUT=1
33− export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
34− '';
27+ nativeBuildInputs = [ cmake dotnet-sdk ];
3528
3629 hardeningDisable = [ "strictoverflow" ];
3730
pkgs/servers/jellyfin/default.nix−5
@@ -70,11 +70,6 @@ stdenv.mkDerivation rec {
7070 configurePhase = ''
7171 runHook preConfigure
7272
73− export HOME=$(mktemp -d)
74−
75− export DOTNET_CLI_TELEMETRY_OPTOUT=1
76− export DOTNET_NOLOGO=1
77−
7873 nuget sources Add -Name nixos -Source "$PWD/nixos"
7974 nuget init "$nugetDeps" "$PWD/nixos"
8075
pkgs/servers/nosql/eventstore/default.nix−4
@@ -43,10 +43,6 @@ stdenv.mkDerivation rec {
4343 '';
4444
4545 buildPhase = ''
46− mkdir home
47− export HOME=$PWD/home
48− export DOTNET_CLI_TELEMETRY_OPTOUT=1
49− export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
5046 export FrameworkPathOverride=${mono}/lib/mono/4.7.1-api
5147
5248 # disable default-source so nuget does not try to download from online-repo