!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

121 Members
24 Servers

Load older messages


SenderMessageTime
20 Mar 2025
@xsrp:matrix.org@xsrp:matrix.org changed their display name from Seraphim Pardee to srp.03:19:07
@sananatheskenana:matrix.orglzcuntI've tried that before and it broke the build system severely so I can't do that08:48:15
@sananatheskenana:matrix.orglzcuntupstream supports mono but I tried it and I couldn't get that to work either08:48:47
@sananatheskenana:matrix.orglzcuntI think I'm gonna give up packaging OpenBVE for nixpkgs, I think they have a flatpak or something08:49:11
23 Mar 2025
@whovian9369:matrix.orgWhovian9369 Hey gang, me again to cause more chaos. Do any of you have experience building a project that uses Nuke.Common for building part of the program? Something I use a lot, https://github.com/Thealexbarney/LibHac , uses it for some CodeGen that needs to be done for proper use of the program hactoolnet.
I do have a derivation that pulls the official binary and patches that if I need to use it instead, but it would be nice to make sure that I have a properly working build that I can do if I need to.
15:00:35
@whovian9369:matrix.orgWhovian9369I do also have an existing derivation that skips using Nuke, but it seems to be quietly "broken" in a few ways since the programs expecting you to have done codegen initially.15:02:29
@whovian9369:matrix.orgWhovian9369(You can see that at https://github.com/Whovian9369/whovian_nixos_config/blob/main/home/packages/hactoolnet/package.nix )15:02:49
@whovian9369:matrix.orgWhovian9369Oh I just noticed that Avalonia seems to deal with this already - https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/av/avalonia/package.nix#L151-L159 Is this the suggested way to deal with that, then?15:07:59
24 Mar 2025
@corngood:corngood.comCorngood Whovian9369: Avalonia doesn't use buildDotnetModule. It just uses the dotnet-sdk hooks and addNuGetDeps directly. You could certainly try to do something similar. 12:39:33
@whovian9369:matrix.orgWhovian9369That sounds like my next best attempt. Thanks!14:04:14
@corngood:corngood.comCorngood

Avalonia was a bit of a proof of concept for avoiding buildDotnetModule. addNuGetDeps is not well documented yet, so let me know if you have any trouble.

overrideFetchAttrs is there to allow fetch-deps to handle multiple target platforms (e.g. linux/darwin-x86/arm).

configurePhase should ideally do everything needed to get the nuget dependencies

buildPhase can call build.sh

linkNugetPackages and makeEmptyNupkgInPackages are hacks for things that don't handle NUGET_FALLBACK_PACKAGES properly or make other bad assumptions

14:13:04
@corngood:corngood.comCorngood *

Avalonia was a bit of a proof of concept for avoiding buildDotnetModule. addNuGetDeps is not well documented yet, so let me know if you have any trouble.

overrideFetchAttrs is there to allow fetch-deps to handle multiple target platforms (e.g. linux/darwin-x86/arm).

configurePhase should ideally do everything needed to get the nuget dependencies

buildPhase can call build.sh

linkNugetPackages and makeEmptyNupkgInPackages are hacks for things that don't handle NUGET_FALLBACK_PACKAGES properly or make other bad assumptions (use them only if necessary)

14:13:38
1 Apr 2025
@sandro:supersandro.deSandro 🐧 changed their display name from Sandro 🐧 to Sandro 🐧 [c3d2].13:56:06
@sandro:supersandro.deSandro 🐧 changed their display name from Sandro 🐧 [c3d2] to "Sandro [c3d2]".13:56:50
@sandro:supersandro.deSandro 🐧 changed their display name from "Sandro [c3d2]" to Sandro 🐧 [c3d2].13:57:23
@sandro:supersandro.deSandro 🐧 changed their display name from Sandro 🐧 [c3d2] to Sandro 🐧.13:58:37
3 Apr 2025
@c00l_game_dev:matrix.orgc00l_game_dev joined the room.19:48:31
7 Apr 2025
@genga898:matrix.orgEmmanuel Genga set a profile picture.18:11:00
10 Apr 2025
@anselmetombarel:matrix.organselmetombarel joined the room.14:47:27
@magikarpz:matrix.orgmdarocha

can somebody with commit permissions take a look at this PR? https://github.com/NixOS/nixpkgs/pull/257489

I'd really want to get going on removing the deprecated buildDotnetPackage stuff, and this PR was blocking it for quite some time

20:54:02
@sandro:supersandro.deSandro 🐧 the right room for that is #review-requests:nixos.org 22:51:51
19 Apr 2025
@corruptcomputer:matrix.orgcorruptcomputer joined the room.02:47:34
@corruptcomputer:matrix.orgcorruptcomputer

Could someone please help me figure out how to get the dotnet sdk to work on NixOS? Neither wiki has any usable information on getting this setup, so I've basically just guessed at which packages I found when searching for 'dotnet' on search.nixos.org were the correct ones. The names of these seemed the most correct to me and thats all I picked based on, so if these aren't right please let me know

I have the following in my configuration.nix (removed the unrelated parts):

environment = {
  sessionVariables = {
    DOTNET_ROOT = "${pkgs.dotnet-sdk_9}/share/dotnet/";
  };
  
  systemPackages = with pkgs; [
    dotnet-aspnetcore_9
    dotnet-runtime_9
    dotnet-sdk_9
  ];
};

I've added the dotnet-sdk_9 dotnet root since the wiki said thats what to do if its not found, but that doesn't seem to have any effect. Its still not able to access the sdk unless I cd to that dir and use the filesystem local dotnet instead of the system one:

[ngupton@armadillo:~]$ dotnet --list-runtimes
Microsoft.AspNetCore.App 9.0.3 [/nix/store/7vpnwiiqjhlqg0d1ar7vk3fdis39xzlp-aspnetcore-runtime-9.0.3/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.3 [/nix/store/7vpnwiiqjhlqg0d1ar7vk3fdis39xzlp-aspnetcore-runtime-9.0.3/share/dotnet/shared/Microsoft.NETCore.App]

[ngupton@armadillo:~]$ dotnet --list-sdks

[ngupton@armadillo:~]$ cd $DOTNET_ROOT

[ngupton@armadillo:/nix/store/6p8ca1aaj3hpswi1b12si274kf550hk1-dotnet-sdk-wrapped-9.0.202/share/dotnet]$ ./dotnet --list-sdks
9.0.202 [/nix/store/h7yk3aivlacy0c0d87ivg7fhvpxkmr44-dotnet-sdk-9.0.202/share/dotnet/sdk]
03:14:52
@corruptcomputer:matrix.orgcorruptcomputer *

Could someone please help me figure out how to get the dotnet sdk to work on NixOS? Neither wiki has any usable information on getting this setup, seems to assume you're trying to build a dotnet nix package instead of actually use dotnet on your system. So I've basically just guessed at which packages I found when searching for 'dotnet' on search.nixos.org were the correct ones. The names of these seemed the most correct to me and thats all I picked based on, so if these aren't right please let me know

I have the following in my configuration.nix (removed the unrelated parts):

environment = {
  sessionVariables = {
    DOTNET_ROOT = "${pkgs.dotnet-sdk_9}/share/dotnet/";
  };
  
  systemPackages = with pkgs; [
    dotnet-aspnetcore_9
    dotnet-runtime_9
    dotnet-sdk_9
  ];
};

I've added the dotnet-sdk_9 dotnet root since the wiki said thats what to do if its not found, but that doesn't seem to have any effect. Its still not able to access the sdk unless I cd to that dir and use the filesystem local dotnet instead of the system one:

[ngupton@armadillo:~]$ dotnet --list-runtimes
Microsoft.AspNetCore.App 9.0.3 [/nix/store/7vpnwiiqjhlqg0d1ar7vk3fdis39xzlp-aspnetcore-runtime-9.0.3/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.3 [/nix/store/7vpnwiiqjhlqg0d1ar7vk3fdis39xzlp-aspnetcore-runtime-9.0.3/share/dotnet/shared/Microsoft.NETCore.App]

[ngupton@armadillo:~]$ dotnet --list-sdks

[ngupton@armadillo:~]$ cd $DOTNET_ROOT

[ngupton@armadillo:/nix/store/6p8ca1aaj3hpswi1b12si274kf550hk1-dotnet-sdk-wrapped-9.0.202/share/dotnet]$ ./dotnet --list-sdks
9.0.202 [/nix/store/h7yk3aivlacy0c0d87ivg7fhvpxkmr44-dotnet-sdk-9.0.202/share/dotnet/sdk]
03:22:11
@corruptcomputer:matrix.orgcorruptcomputer

Ah finally got it figured out, changing the packages to the following fixed it

systemPackages = with pkgs; [
  (with dotnetCorePackages; combinePackages [dotnet_9.sdk dotnet_8.sdk])
];
07:38:26
@gggkiller:matrix.orgGGGyou actually need to have the SDK and no runtimes08:10:20
@gggkiller:matrix.orgGGG

corruptcomputer: ```
environment = let
dotnet-sdk = with dotnetCorePackages; combinePackages [ sdk_9_0 sdk_8_0 ];
dotnetRoot = "${dotnet-sdk}/share/dotnet";
in {
etc = {
"dotnet/install_location".text = dotnetRoot;
};

systemPackages = with pkgs; [
dotnet-sdk
];
};

08:13:21
@gggkiller:matrix.orgGGG *

corruptcomputer:

environment = let
dotnet-sdk = with dotnetCorePackages; combinePackages \[ sdk\_9\_0 sdk\_8\_0 \];
dotnetRoot = "${dotnet-sdk}/share/dotnet";
in {
etc = {
"dotnet/install\_location".text = dotnetRoot;
};

systemPackages = with pkgs; \[
dotnet-sdk
\];
};
08:13:27
@gggkiller:matrix.orgGGG *

corruptcomputer:

environment = let
  dotnet-sdk = with dotnetCorePackages; combinePackages [ sdk_9_0 sdk_8_0 ];
  dotnetRoot = "${dotnet-sdk}/share/dotnet";
in {
  etc = {
    "dotnet/install\_location".text = dotnetRoot;
  };

  systemPackages = with pkgs; [
    dotnet-sdk
  ];
};

this is what I do in my config: https://github.com/GGG-KILLER/nixos-configs/blob/3553a0247d667bd3d83937e52d63625ba592c1c5/hosts/sora/system/programs/default.nix#L10-L18

08:14:02
@gggkiller:matrix.orgGGG *

corruptcomputer:

environment = let
  dotnet-sdk = with dotnetCorePackages; combinePackages [ sdk_9_0 sdk_8_0 ];
  dotnetRoot = "${dotnet-sdk}/share/dotnet";
in {
  etc = {
    "dotnet/install_location".text = dotnetRoot;
  };

  systemPackages = with pkgs; [
    dotnet-sdk
  ];
};

this is what I do in my config: https://github.com/GGG-KILLER/nixos-configs/blob/3553a0247d667bd3d83937e52d63625ba592c1c5/hosts/sora/system/programs/default.nix#L10-L18

08:14:11

Show newer messages


Back to Room ListRoom Version: 9