Inability to define DOTNET_ROOT

I rely on a global dotnet tool, that is dotnet-ef. before doing an update i could use it by providing the environment variable DOTNET_ROOT as:
export DOTNET_ROOT=$(nix eval --raw nixpkgs#dotnet-sdk_8)

However, now it stopped working.

output of dotnet --info:

.NET SDK:
 Version:           8.0.111
 Commit:            ad116b5ce0
 Workload version:  8.0.100-manifests.7198dcc9

Runtime Environment:
 OS Name:     nixos
 OS Version:  25.05
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /nix/store/x331hqv5dqcxycnawgq9cpwadaw4j577-dotnet-sdk-8.0.111/share/dotnet/sdk/8.0.111/

.NET workloads installed:
 Workload version: 8.0.100-manifests.7198dcc9
There are no installed workloads to display.

Host:
  Version:      8.0.11
  Architecture: x64
  Commit:       9cb3b725e3

.NET SDKs installed:
  8.0.111 [/nix/store/x331hqv5dqcxycnawgq9cpwadaw4j577-dotnet-sdk-8.0.111/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.11 [/nix/store/x331hqv5dqcxycnawgq9cpwadaw4j577-dotnet-sdk-8.0.111/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.11 [/nix/store/x331hqv5dqcxycnawgq9cpwadaw4j577-dotnet-sdk-8.0.111/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/nix/store/jbzrycf46nw5np8miakdisqircfwa143-dotnet-sdk-wrapped-8.0.404]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

output of dotnet ef --version:

You must install .NET to run this application.

App: /home/wadsaek/.dotnet/tools/dotnet-ef
Architecture: x64
App host version: 8.0.11
.NET location: Not found

Learn more:
https://aka.ms/dotnet/app-launch-failed

Download the .NET runtime:
https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=linux-x64&os=nixos.25.05&apphost_version=8.0.11

does anyone know how i can do this now?

after some screwing around, i found out that setting DOTNET_ROOT to /nix/store/x331hqv5dqcxycnawgq9cpwadaw4j577-dotnet-sdk-8.0.111/share/dotnet (one of the parent directories of the installed runtime) worked. at thist point i just need to figure out which package that is

Try this one:

  environment.sessionVariables = {
    DOTNET_ROOT = "${pkgs.dotnet-sdk_8}";
  };