Tool to build and package dotnet-sdk applications with nix
It is currently working for simple projects and solutions with one project.
- Support for whole solutions or multiple projects
- Discovery works
- Publishing
- Authentication through netrc file
- Parses
Nuget.Config
files for sources and credentials -
<DotNetCliToolReference>
support (Not part of project.assets.json) -
--self-contained
binaries, requires--runtime
identifier + additional individual packages on restore - Support native code
nix-env -i dotnet2nix -f ./
- Change into your dotnet project/solution directory
- Restore the packages using a lockfile
dotnet restore --use-lock-file
- Run
dotnet2nix
to get anugets.json
file. - add
pkgs/dotnet2nixBuilder
builder to your overlay/flake.
With NuGet, packages can be updated in place.
I experienced this problem with a project having multiple package sources.
If multiple sources have a package with the same version string,
the faster one wins with dotnet restore
Some packages got overwritten with an updated version to add repo signatures. This changes the hash. If packages will get updated often in place, it could get problematic. See nuget.org blog post and my ticket
With the current dotnet restore
, if a package is present in multiple sources, the fastest one wins.
This can lead to inconsistencies if there are packages with different signatures and checksums.
See nuget ticket
Use a netrc
file. Nix will use the
following
location by default: $NIX_CONF_DIR/netrc
. The contents are as follows:
machine hostname-of-the-feed
login my-username
password my-password
...
For more details see the curl documentation on netrc