Skip to content

Commit

Permalink
dotnet: nixfmt output of nuget-to-nix
Browse files Browse the repository at this point in the history
  • Loading branch information
corngood committed Dec 3, 2024
1 parent ccaf469 commit 60b72eb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions pkgs/build-support/dotnet/add-nuget-deps/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
lib,
substituteAll,
nuget-to-nix,
nixfmt-rfc-style,
cacert,
fetchNupkg,
callPackage,
Expand Down Expand Up @@ -67,6 +68,7 @@ attrs
isExecutable = true;
inherit cacert;
nugetToNix = nuget-to-nix;
nixfmt = nixfmt-rfc-style;
};

defaultDepsFile =
Expand Down
2 changes: 2 additions & 0 deletions pkgs/build-support/dotnet/add-nuget-deps/fetch-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
7 changes: 6 additions & 1 deletion pkgs/development/compilers/dotnet/stage0.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
nix,
cacert,
nuget-to-nix,
nixfmt-rfc-style,
dotnetCorePackages,
xmlstarlet,
patchNupkgs,
Expand Down Expand Up @@ -94,6 +95,7 @@ let
nix
cacert
nuget-to-nix
nixfmt-rfc-style
];
postPatch =
old.postPatch or ""
Expand Down Expand Up @@ -138,7 +140,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
'';
};
Expand Down
5 changes: 3 additions & 2 deletions pkgs/development/tools/godot/3/mono/make-deps.nix
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
'';

Expand Down

0 comments on commit 60b72eb

Please sign in to comment.