!bxVOQwsVoHhZcmNDGw:nixos.org

Nix + dotnet

125 Members
24 Servers

Load older messages


SenderMessageTime
21 Apr 2025
@gggkiller:matrix.orgGGGdo what in your nixos config exactly?23:24:54
@gggkiller:matrix.orgGGGI think corngood changed the SDK to have that file by default iirc23:25:07
@6pak:matrix.org6pakoh23:25:12
@6pak:matrix.org6pakthe source built ones might have them sure23:25:16
@6pak:matrix.org6pakI use the binary sdks23:25:20
@gggkiller:matrix.orgGGGoh, the binary ones don't? we should change the install script to fix that23:25:38
@6pak:matrix.org6pakactually I don't see the userlocal file in source built sdks either?23:27:03
@6pak:matrix.org6pakoh, only 1xx feature band is source built, right23:27:47
@corruptcomputer:matrix.orgcorruptcomputerSo out of curiosity, if I were wanting to try to contribute to NixOS, how would I do that? I've never contributed to a distro before, but NixOS to me seems like it might be a good place to start since everything is defined as code so I'm hoping it'll be a lot more familiar to me as a developer than other distros are23:28:10
@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

Show newer messages


Back to Room ListRoom Version: 9