From 6b84101c477ab7b89322aa24a26e4d14affb84e3 Mon Sep 17 00:00:00 2001 From: mdarocha Date: Tue, 20 Jun 2023 17:19:30 +0200 Subject: [PATCH] omnisharp-roslyn: use usedotnetFromEnv instead of overriding fixup phase --- .../tools/omnisharp-roslyn/default.nix | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/pkgs/development/tools/omnisharp-roslyn/default.nix b/pkgs/development/tools/omnisharp-roslyn/default.nix index d24c119e4212..b5e2e0f6e68c 100644 --- a/pkgs/development/tools/omnisharp-roslyn/default.nix +++ b/pkgs/development/tools/omnisharp-roslyn/default.nix @@ -23,7 +23,8 @@ let finalPackage = buildDotnetModule rec { projectFile = "src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj"; nugetDeps = ./deps.nix; - useAppHost = false; + dotnet-sdk = sdk_6_0; + dotnet-runtime = sdk_6_0; dotnetInstallFlags = [ "--framework net6.0" ]; dotnetBuildFlags = [ "--framework net6.0" "--no-self-contained" ]; @@ -48,24 +49,8 @@ let finalPackage = buildDotnetModule rec { done ''; - dontDotnetFixup = true; # we'll fix it ourselves - preFixup = '' - # We create a wrapper that will run the OmniSharp dll using the `dotnet` - # executable from PATH. Doing it this way allows it to run using newer SDK - # versions than it was build with, which allows it to properly find those SDK - # versions - OmniSharp only finds SDKs with the same version or newer as - # itself. We still provide a fallback, in case no `dotnet` is provided in - # PATH - mkdir -p "$out/bin" - - cat << EOF > "$out/bin/OmniSharp" - #!${stdenv.shell} - export PATH="\''${PATH}:${sdk_6_0}/bin" - dotnet "$out/lib/omnisharp-roslyn/OmniSharp.dll" "\$@" - EOF - - chmod +x "$out/bin/OmniSharp" - ''; + useDotnetFromEnv = true; + executables = [ "OmniSharp" ]; passthru.tests = let with-sdk = sdk: runCommand "with-${if sdk ? version then sdk.version else "no"}-sdk"