mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
dotnet-sdk-setup-hook: add nuget.org as a package source when there is no <clear/>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,22 +1,12 @@
|
||||
{
|
||||
lib,
|
||||
openssl,
|
||||
writeText,
|
||||
git,
|
||||
buildDotnetModule,
|
||||
dotnetCorePackages,
|
||||
fetchFromGitHub,
|
||||
testers,
|
||||
}:
|
||||
let
|
||||
nuget-config = writeText "nuget.config" ''
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
'';
|
||||
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;
|
||||
|
||||
@@ -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[@]}")
|
||||
|
||||
Reference in New Issue
Block a user