!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

99 Members
22 Servers

Load older messages


SenderMessageTime
21 Apr 2025
@6pak:matrix.org6pakRedacted or Malformed Event23:28:17
@gggkiller:matrix.orgGGGyeah, only it is built23:28:28
@corruptcomputer:matrix.orgcorruptcomputerI've briefly looked into contributing to fedora before, but it seemed so over the top complicated that I just gave up before I even started23:28:35
@gggkiller:matrix.orgGGG also, things might have changed. I'm not finding anything with nix-locate 23:28:44
@6pak:matrix.org6pak

Message deleted by NixOS Moderation Bot

wha

23:28:45
@6pak:matrix.org6pak
/tmp 
❯ nix build p#dotnetCorePackages.sdk_9_0_1xx && ls -R ./result/share/dotnet/metadata/workloads/
 9.0.100

./result/share/dotnet/metadata/workloads/9.0.100:
 userlocal

/tmp 
❯ nix build p#dotnetCorePackages.sdk_9_0_1xx-bin && ls -R ./result/share/dotnet/metadata/workloads/
"./result/share/dotnet/metadata/workloads/": No such file or directory (os error 2)
[ble: exit 2]
23:29:02
@gggkiller:matrix.orgGGGoh yeah, with the whole illegal image spam fiasco in the main NixOS room, image uploading got restricted23:29:10
@gggkiller:matrix.orgGGG basically find what you want to change in the nixpkgs monorepo, make the changes you want, commit into a new branch, run nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD" and then run the programs to see if they still work 23:32:15
@gggkiller:matrix.orgGGGbut .NET is more annoying than usual because if you change something in the SDKs, they'll cause every .NET program in nixpkgs to also be rebuilt, so you'll spend quite a few hours on the rebuild23:32:49
@gggkiller:matrix.orgGGGI recommend reading parts of the nixpkgs manual first, so you learn how things work in nix, since it's quite different from any other distro23:33:20
@gggkiller:matrix.orgGGG * basically find what you want to change in the nixpkgs monorepo, make the changes you want, commit into a new branch, run nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD" and then run the programs to see if they still work and make a PR back to the main repo 23:33:50
@corruptcomputer:matrix.orgcorruptcomputerJust to be sure, is this the manual you mean? https://nixos.org/manual/nixpkgs/stable/index.html23:34:21
@6pak:matrix.org6paknixos is unique, but that's what makes it the easiest distro to contribute to imo23:34:24
@6pak:matrix.org6pak(and then just stare at your open prs not having any commiters reviewing it)23:34:40
@gggkiller:matrix.orgGGGyes23:34:45
@gggkiller:matrix.orgGGGit's quite long so I just jump around looking at the parts that I don't understand usually23:35:03
@gggkiller:matrix.orgGGGmaybe not the best way, but it is the fastest way (and efficient enough for me)23:35:19
@corruptcomputer:matrix.orgcorruptcomputerAlright, thanks! I'll take a read though what seem like the relevant parts of that, yeah that page is really long. I've read through quite a few man pages though, so it can't be as bad as some of those23:36:36
@corruptcomputer:matrix.orgcorruptcomputer taking 4 pages to say like ls -l will print out the files in a list format lol 23:36:58
@6pak:matrix.org6pak
dotnet-combined =
    (
      with pkgs.dotnetCorePackages;
      combinePackages [
        sdk_10_0-bin
        sdk_9_0-bin
        sdk_8_0-bin
      ]
    ).overrideAttrs
      (old: {
        src = old.src.overrideAttrs (old: {
          postBuild =
            (old.postBuild or "")
            # This is needed to install workload in $HOME
            + ''
              for i in $out/share/dotnet/sdk/*
              do
                i="$(basename $i)"
                i="''${i/-*}" # strip pre-release label
                i="''${i::-2}00" # strip patch

                mkdir -p "$out/share/dotnet/metadata/workloads/$i"
                touch "$out/share/dotnet/metadata/workloads/$i/userlocal"
              done
            '';
        });
      });

this works as a workaround for installing workloads in home

23:42:52
@6pak:matrix.org6pakideally build-dotnet.nix in nixpkgs should just add that file23:43:09
@gggkiller:matrix.orgGGGyeah, I might make a PR to do that23:43:22
@gggkiller:matrix.orgGGG

yeah, seems like only the source-built variants have that:

$ nix-locate userlocal               
dotnetCorePackages.dotnet_8.vmr.out                   0 r /nix/store/agr6lyqz3zp4a3llaa0sx1x1i624r55k-dotnet-vmr-8.0.14/dotnet-sdk-8.0.114-linux-x64/metadata/workloads/8.0.100/userlocal
dotnetCorePackages.dotnet_10.vmr.out                  0 r /nix/store/vfd744wlv3338igbai9q711p8647hn75-dotnet-vmr-10.0.0-preview.2/dotnet-sdk-10.0.100-preview.2.25164.1-linux-x64/metadata/workloads/10.0.100/userlocal
(dotnetCorePackages.dotnet_9.sdk.out)                 0 r /nix/store/d3cndkqm57ika3qb2abmvr5snr4fp6pc-dotnet-sdk-9.0.104/share/dotnet/metadata/workloads/9.0.100/userlocal
dotnetCorePackages.dotnet_9.vmr.out                   0 r /nix/store/b679fsfkc571n08cr95zsrh0xgzbn3q4-dotnet-vmr-9.0.3/dotnet-sdk-9.0.104-linux-x64/metadata/workloads/9.0.100/userlocal
(dotnet-sdk_10.out)                                   0 r /nix/store/k1qkscqxcvs801bqihl9rwjm19dpr2xs-dotnet-sdk-10.0.100-preview.2.25164.1/share/dotnet/metadata/workloads/10.0.100/userlocal
(dotnetCorePackages.dotnet_8.sdk.out)                 0 r /nix/store/1nqkg50ljc7rxvhg58f8iws7nqb5mwxa-dotnet-sdk-8.0.114/share/dotnet/metadata/workloads/8.0.100/userlocal
23:44:09
@6pak:matrix.org6pakI hope it just changes the install path but still also discovers workloads from system paths23:44:31
@6pak:matrix.org6pakfor future declarative workloads23:44:41
22 Apr 2025
@corruptcomputer:matrix.orgcorruptcomputer

I've got dotnet up and running well with the suggested config for it, even after changing vscode its still not able to open a solution, gives me an error "command 'csdevkit.openSolution' not found". Have the following configuration for that:

systemPackages = with pkgs; [
  (vscode-with-extensions.override {
      vscodeExtensions = with vscode-extensions; [
        ms-dotnettools.csharp
        ms-dotnettools.vscode-dotnet-runtime
        ms-dotnettools.csdevkit
        ms-dotnettools.vscodeintellicode-csharp
      ] ++ vscode-utils.extensionsFromVscodeMarketplace [
        # To get sha256: nix-prefetch-url https://marketplace.visualstudio.com/_apis/public/gallery/publishers/[publisher]/vsextensions/[name]/[version]/vspackage
        {
            name = "vscode-entity-framework";
            publisher = "richardwillis";
            version = "0.0.20";
            sha256 = "0karaxnaalhr08n7dyc89wr5i3y9jxa5nfiyqcxdg4ws0p3zcsbk";
        }
        {
            name = "vscode-avalonia";
            publisher = "avaloniateam";
            version = "0.0.32";
            sha256 = "1vrsnq7v0p508c077g62yy2h9l8dqgad5929nnyqiys3bcx5ksnq";
        }
      ];
  })
];

Any idea what might I be missing here?

02:27:58
@corruptcomputer:matrix.orgcorruptcomputerI can see the extension in vscode, and I can see its command in the F1 menu for opening the solution, its just when I try to do that it gives me that error02:29:45
23 Apr 2025
@corruptcomputer:matrix.orgcorruptcomputer

well, I think I've figured out why. On the docs for that extension, they have a section with a list of reasons why the command might not be found:

using a readonly OS. C# Dev Kit requires write access to its own extension folder and to the VS Code-provided folder for extensions to write arbitrary state within the operating system, so if you are using an OS that is completely readonly, C# Dev Kit will not work.

Which I think would mean it doesn't work on NixOS, right?

04:37:29
@gggkiller:matrix.orgGGGNo, it should work since I patch it to work under those conditions05:28:03
@gggkiller:matrix.orgGGGbut if you are having troubles with that, you can open an issue and mention me, since I'm the maintainer for them05:28:16

Show newer messages


Back to Room ListRoom Version: 9