diff --git a/pkgs/by-name/ps/ps3-disc-dumper/package.nix b/pkgs/by-name/ps/ps3-disc-dumper/package.nix index 7d90e7ad1549..59553b16acda 100644 --- a/pkgs/by-name/ps/ps3-disc-dumper/package.nix +++ b/pkgs/by-name/ps/ps3-disc-dumper/package.nix @@ -27,12 +27,6 @@ buildDotnetModule rec { projectFile = "UI.Avalonia/UI.Avalonia.csproj"; nugetDeps = ./deps.json; - preConfigureNuGet = '' - # This should really be in the upstream nuget.config - dotnet nuget add source https://api.nuget.org/v3/index.json \ - -n nuget.org --configfile nuget.config - ''; - runtimeDeps = [ zlib openssl diff --git a/pkgs/by-name/re/recyclarr/package.nix b/pkgs/by-name/re/recyclarr/package.nix index f729757aed3a..7ac3bb36fb62 100644 --- a/pkgs/by-name/re/recyclarr/package.nix +++ b/pkgs/by-name/re/recyclarr/package.nix @@ -1,22 +1,12 @@ { lib, openssl, - writeText, git, buildDotnetModule, dotnetCorePackages, fetchFromGitHub, testers, }: -let - nuget-config = writeText "nuget.config" '' - - - - - - ''; -in buildDotnetModule (finalAttrs: { pname = "recyclarr"; version = "7.4.1"; @@ -47,8 +37,6 @@ buildDotnetModule (finalAttrs: { enableParallelBuilding = false; - dotnetRestoreFlags = [ "--configfile=${nuget-config}" ]; - doCheck = false; dotnet-sdk = dotnetCorePackages.sdk_9_0; diff --git a/pkgs/development/compilers/dotnet/dotnet-sdk-setup-hook.sh b/pkgs/development/compilers/dotnet/dotnet-sdk-setup-hook.sh index 76f8734d4e12..fc4a5ba9f315 100644 --- a/pkgs/development/compilers/dotnet/dotnet-sdk-setup-hook.sh +++ b/pkgs/development/compilers/dotnet/dotnet-sdk-setup-hook.sh @@ -85,6 +85,7 @@ configureNuget() { rootConfig=$(find . -maxdepth 1 -iname nuget.config -print -quit) if [[ -z $rootConfig ]]; then dotnet new nugetconfig + rootConfig=nuget.config fi ( @@ -100,6 +101,12 @@ configureNuget() { -i /configuration/packageSources/__new -t attr -n value -v "$nugetSource" -r /configuration/packageSources/__new -v add) + if [[ -n ${keepNugetConfig-} ]] && + ! @xmlstarlet@/bin/xmlstarlet select -t -i "/configuration/packageSources/clear" -nl "$rootConfig" && + ! @xmlstarlet@/bin/xmlstarlet select -t -i "/configuration/packageSources/add[@value='https://api.nuget.org/v3/index.json' or @key='nuget.org']" -nl "$rootConfig"; then + dotnet nuget add source https://api.nuget.org/v3/index.json --name nuget.org --configfile "$rootConfig" + fi + if [[ -z ${keepNugetConfig-} ]]; then xmlConfigArgs+=(-d '//configuration/*') xmlRootConfigArgs+=("${xmlSourceConfigArgs[@]}")