Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
/ dotnet2nix Public archive

Tool to convert dotnet core dependencies to nix expressions, this project itself is the test case for now

Notifications You must be signed in to change notification settings

baracoder/dotnet2nix

Repository files navigation

dotnet2nix

Tool to build and package dotnet-sdk applications with nix

Project status

It is currently working for simple projects and solutions with one project.

Features

  • 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

Installation

nix-env -i dotnet2nix -f ./

Usage

  1. Change into your dotnet project/solution directory
  2. Restore the packages using a lockfile dotnet restore --use-lock-file
  3. Run dotnet2nix to get a nugets.json file.
  4. add pkgs/dotnet2nixBuilder builder to your overlay/flake.

Problems

Packages updated in-place

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

Authentication

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

About

Tool to convert dotnet core dependencies to nix expressions, this project itself is the test case for now

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published