From 6489349833d4d929dfb05702773cdd87156ece65 Mon Sep 17 00:00:00 2001 From: chavic Date: Fri, 15 May 2026 17:39:36 +0200 Subject: [PATCH] Add C# SDK to nix dev shell Provide .NET 10 SDK tooling in the default nix development shell while keeping the .NET 8 runtime available for the current net8.0 C# tests. Opt out of dotnet CLI telemetry and document the nix command that generates bindings and runs the C# test suite. --- flake.nix | 8 ++++++++ payjoin-ffi/csharp/README.md | 7 +++++++ payjoin-ffi/csharp/global.json | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 1b6e489b0..aa2f95097 100644 --- a/flake.nix +++ b/flake.nix @@ -270,6 +270,11 @@ "payjoin-mailroom-image" = mkContainerImage "payjoin-mailroom" packages.payjoin-mailroom tag; }; + dotnetSdk = pkgs.dotnetCorePackages.combinePackages [ + pkgs.dotnetCorePackages.sdk_10_0 + pkgs.dotnetCorePackages.runtime_8_0 + ]; + devShells = builtins.mapAttrs ( _name: craneLib: craneLib.devShell { @@ -281,6 +286,7 @@ cargo-watch rust-analyzer dart + dotnetSdk cargo-fuzz bzip2 # needed for some machines to have access to libzip at runtime codespell @@ -290,6 +296,8 @@ ]; BITCOIND_EXE = pkgs.lib.getExe' pkgs.bitcoind "bitcoind"; BITCOIND_SKIP_DOWNLOAD = 1; + DOTNET_ROOT = "${dotnetSdk}/share/dotnet"; + DOTNET_CLI_TELEMETRY_OPTOUT = "1"; } ) craneLibVersions; diff --git a/payjoin-ffi/csharp/README.md b/payjoin-ffi/csharp/README.md index 9afccc5c3..c6270d00c 100644 --- a/payjoin-ffi/csharp/README.md +++ b/payjoin-ffi/csharp/README.md @@ -6,6 +6,13 @@ Welcome to the C# language bindings for the [Payjoin Dev Kit](https://payjoindev Follow these steps to clone the repository and run the tests. +With nix, the default development shell provides the Rust toolchain, .NET 10 SDK, +and .NET 8 runtime: + +```shell +nix develop -c bash payjoin-ffi/csharp/contrib/test.sh +``` + ```shell git clone https://github.com/payjoin/rust-payjoin.git cd rust-payjoin/payjoin-ffi/csharp diff --git a/payjoin-ffi/csharp/global.json b/payjoin-ffi/csharp/global.json index 391ba3c2a..512142d2b 100644 --- a/payjoin-ffi/csharp/global.json +++ b/payjoin-ffi/csharp/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "10.0.100", "rollForward": "latestFeature" } }