dotnet: nixfmt output of nuget-to-nix (#361579)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
lib,
|
||||
substituteAll,
|
||||
nuget-to-nix,
|
||||
nixfmt-rfc-style,
|
||||
cacert,
|
||||
fetchNupkg,
|
||||
callPackage,
|
||||
@@ -67,6 +68,7 @@ attrs
|
||||
isExecutable = true;
|
||||
inherit cacert;
|
||||
nugetToNix = nuget-to-nix;
|
||||
nixfmt = nixfmt-rfc-style;
|
||||
};
|
||||
|
||||
defaultDepsFile =
|
||||
|
||||
@@ -7,5 +7,7 @@ genericBuild
|
||||
@nugetToNix@/bin/nuget-to-nix "${NUGET_PACKAGES%/}"
|
||||
) > deps.nix
|
||||
|
||||
@nixfmt@/bin/nixfmt deps.nix
|
||||
|
||||
mv deps.nix "$1"
|
||||
echo "Succesfully wrote lockfile to $1"
|
||||
|
||||
@@ -31,6 +31,12 @@ buildDotnetModule rec {
|
||||
--replace-fail 'net6.0' 'net8.0'
|
||||
'';
|
||||
|
||||
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 = [
|
||||
bc
|
||||
];
|
||||
|
||||
@@ -5,4 +5,5 @@
|
||||
releaseInfoFile = ./release-info.json;
|
||||
bootstrapSdkFile = ./bootstrap-sdk.nix;
|
||||
depsFile = ./deps.nix;
|
||||
fallbackTargetPackages = dotnetCorePackages.sdk_8_0.targetPackages;
|
||||
}
|
||||
|
||||
@@ -6,4 +6,5 @@
|
||||
bootstrapSdkFile = ./bootstrap-sdk.nix;
|
||||
allowPrerelease = true;
|
||||
depsFile = ./deps.nix;
|
||||
fallbackTargetPackages = dotnetCorePackages.sdk_9_0.targetPackages;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
bootstrapSdkFile,
|
||||
allowPrerelease ? false,
|
||||
depsFile,
|
||||
fallbackTargetPackages,
|
||||
pkgsBuildHost,
|
||||
buildDotnetSdk,
|
||||
}:
|
||||
@@ -25,6 +26,7 @@ let
|
||||
releaseManifestFile
|
||||
tarballHash
|
||||
depsFile
|
||||
fallbackTargetPackages
|
||||
;
|
||||
bootstrapSdk = (buildDotnetSdk bootstrapSdkFile).sdk.unwrapped.overrideAttrs (old: {
|
||||
passthru = old.passthru or { } // {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
nix,
|
||||
cacert,
|
||||
nuget-to-nix,
|
||||
nixfmt-rfc-style,
|
||||
dotnetCorePackages,
|
||||
xmlstarlet,
|
||||
patchNupkgs,
|
||||
@@ -16,6 +17,7 @@
|
||||
releaseManifestFile,
|
||||
tarballHash,
|
||||
depsFile,
|
||||
fallbackTargetPackages,
|
||||
bootstrapSdk,
|
||||
}:
|
||||
|
||||
@@ -94,6 +96,7 @@ let
|
||||
nix
|
||||
cacert
|
||||
nuget-to-nix
|
||||
nixfmt-rfc-style
|
||||
];
|
||||
postPatch =
|
||||
old.postPatch or ""
|
||||
@@ -138,7 +141,10 @@ let
|
||||
--arg list "[ ''${depsFiles[*]} ]" \
|
||||
--argstr baseRid ${targetRid} \
|
||||
--arg otherRids '${lib.generators.toPretty { multiline = false; } otherRids}' \
|
||||
) > "${toString prebuiltPackages.sourceFile}"
|
||||
) > deps.nix
|
||||
nixfmt deps.nix
|
||||
|
||||
mv deps.nix "${toString prebuiltPackages.sourceFile}"
|
||||
EOF
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
tarballHash,
|
||||
depsFile,
|
||||
bootstrapSdk,
|
||||
fallbackTargetPackages,
|
||||
}@args:
|
||||
|
||||
let
|
||||
@@ -33,8 +34,7 @@ let
|
||||
|
||||
in
|
||||
mkPackages {
|
||||
inherit vmr;
|
||||
fallbackTargetPackages = bootstrapSdk.targetPackages;
|
||||
inherit vmr fallbackTargetPackages;
|
||||
}
|
||||
// {
|
||||
stage0 = lib.dontRecurseIntoAttrs stage0;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{ godot3-mono, nuget-to-nix }:
|
||||
{ godot3-mono, nuget-to-nix, nixfmt-rfc-style }:
|
||||
|
||||
godot3-mono.overrideAttrs (self: base: {
|
||||
pname = "godot3-mono-make-deps";
|
||||
|
||||
nativeBuildInputs = base.nativeBuildInputs ++ [ nuget-to-nix ];
|
||||
nativeBuildInputs = base.nativeBuildInputs ++ [ nuget-to-nix nixfmt-rfc-style ];
|
||||
|
||||
nugetDeps = null;
|
||||
nugetSource = null;
|
||||
@@ -50,6 +50,7 @@ godot3-mono.overrideAttrs (self: base: {
|
||||
nugetRestore modules/mono/editor/GodotTools/GodotTools.sln
|
||||
|
||||
nuget-to-nix nugetPackages > "$outdir"/deps.nix
|
||||
nixfmt "$outdir"/deps.nix
|
||||
popd > /dev/null
|
||||
'';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user