Unverified Commit 13a97514 authored by David McFarland's avatar David McFarland Committed by GitHub
Browse files

dotnet: add override mechanism for nuget packages (#339953)

parents a6a1dbb7 14c908cd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ The `dotnetCorePackages.sdk` contains both a runtime and the full sdk of a given
To package Dotnet applications, you can use `buildDotnetModule`. This has similar arguments to `stdenv.mkDerivation`, with the following additions:

* `projectFile` is used for specifying the dotnet project file, relative to the source root. These have `.sln` (entire solution) or `.csproj` (single project) file extensions. This can be a list of multiple projects as well. When omitted, will attempt to find and build the solution (`.sln`). If running into problems, make sure to set it to a file (or a list of files) with the `.csproj` extension - building applications as entire solutions is not fully supported by the .NET CLI.
* `nugetDeps` takes either a path to a `deps.nix` file, or a derivation. The `deps.nix` file can be generated using the script attached to `passthru.fetch-deps`. If the argument is a derivation, it will be used directly and assume it has the same output as `mkNugetDeps`.
* `nugetDeps` takes either a path to a `deps.nix` file, or a derivation. The `deps.nix` file can be generated using the script attached to `passthru.fetch-deps`. For compatibility, if the argument is a list of derivations, they will be added to `buildInputs`.
::: {.note}
For more detail about managing the `deps.nix` file, see [Generating and updating NuGet dependencies](#generating-and-updating-nuget-dependencies)
:::
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
  update scripts.
 */
let
  pkgs = import ../.. {};
  pkgs = import ../.. { config.allowAliases = false; };

  inherit (pkgs) lib;

+0 −7
Original line number Diff line number Diff line
@@ -5,9 +5,6 @@
, dotnetCorePackages
, dbus
, fontconfig
, libICE
, libSM
, libX11
, portaudio
}:

@@ -32,10 +29,6 @@ buildDotnetModule rec {

  runtimeDeps = [
    dbus
    fontconfig
    libICE
    libSM
    libX11
    portaudio
  ];

+2 −9
Original line number Diff line number Diff line
@@ -2,22 +2,16 @@
, fetchFromGitHub
, buildDotnetModule
, dotnetCorePackages
, libX11
, libICE
, libSM
, fontconfig
, libsecret
, git
, git-credential-manager
, gnupg
, pass
, testers
, withGuiSupport ? true
, withLibsecretSupport ? true
, withGpgSupport ? true
}:

assert withLibsecretSupport -> withGuiSupport;
buildDotnetModule rec {
  pname = "git-credential-manager";
  version = "2.5.1";
@@ -36,9 +30,8 @@ buildDotnetModule rec {
  dotnetInstallFlags = [ "--framework" "net8.0" ];
  executables = [ "git-credential-manager" ];

  runtimeDeps = [ fontconfig ]
    ++ lib.optionals withGuiSupport [ libX11 libICE libSM ]
    ++ lib.optional withLibsecretSupport libsecret;
  runtimeDeps =
    lib.optional withLibsecretSupport libsecret;
  makeWrapperArgs = [
    "--prefix PATH : ${lib.makeBinPath ([ git ] ++ lib.optionals withGpgSupport [ gnupg pass ])}"
  ];
+10 −8
Original line number Diff line number Diff line
{ buildDotnetModule, emptyDirectory, mkNugetDeps, dotnet-sdk }:
{ buildDotnetModule, emptyDirectory, fetchNupkg, dotnet-sdk }:

{ pname
, version
@@ -23,13 +23,15 @@ buildDotnetModule (args // {

  src = emptyDirectory;

  nugetDeps = mkNugetDeps {
    name = pname;
    nugetDeps = { fetchNuGet }: [
      (fetchNuGet { pname = nugetName; inherit version; sha256 = nugetSha256; hash = nugetHash; })
    ] ++ (nugetDeps fetchNuGet);
  buildInputs = [
    (fetchNupkg {
      pname = nugetName;
      inherit version;
      sha256 = nugetSha256;
      hash = nugetHash;
      installable = true;
  };
    })
  ];

  dotnetGlobalTool = true;

Loading