Loading pkgs/build-support/dotnet/build-dotnet-global-tool/default.nix +79 −53 Original line number Diff line number Diff line { buildDotnetModule, emptyDirectory, fetchNupkg, dotnet-sdk }: { buildDotnetModule, emptyDirectory, fetchNupkg, dotnet-sdk, lib, }: { pname , version fnOrAttrs: buildDotnetModule ( finalAttrs: ( { pname, version, # Name of the nuget package to install, if different from pname , nugetName ? pname nugetName ? pname, # Hash of the nuget package to install, will be given on first build # nugetHash uses SRI hash and should be preferred , nugetHash ? "" , nugetSha256 ? "" nugetHash ? "", nugetSha256 ? "", # Additional nuget deps needed by the tool package , nugetDeps ? (_: []) nugetDeps ? (_: [ ]), # Executables to wrap into `$out/bin`, same as in `buildDotnetModule`, but with # a default of `pname` instead of null, to avoid auto-wrapping everything , executables ? pname executables ? pname, # The dotnet runtime to use, dotnet tools need a full SDK to function , dotnet-runtime ? dotnet-sdk , ... dotnet-runtime ? dotnet-sdk, ... }@args: buildDotnetModule (args // { inherit pname version dotnet-runtime executables; src = emptyDirectory; buildInputs = [ (fetchNupkg { let nupkg = fetchNupkg { pname = nugetName; inherit version; sha256 = nugetSha256; hash = nugetHash; installable = true; }) ]; }; in args // { inherit pname version dotnet-runtime executables ; src = emptyDirectory; buildInputs = [ nupkg ]; dotnetGlobalTool = true; Loading @@ -50,4 +68,12 @@ buildDotnetModule (args // { runHook postInstall ''; }) passthru = { updateScript = ./update.sh; nupkg = nupkg; } // args.passthru or {}; } ) (if lib.isFunction fnOrAttrs then fnOrAttrs finalAttrs else fnOrAttrs) ) pkgs/build-support/dotnet/build-dotnet-global-tool/update.sh 0 → 100755 +24 −0 Original line number Diff line number Diff line #!/usr/bin/env nix-shell #!nix-shell -I nixpkgs=./. -i bash -p curl jq nix common-updater-scripts # shellcheck shell=bash set -euo pipefail attr=$UPDATE_NIX_ATTR_PATH nixeval() { nix --extra-experimental-features nix-command eval --json --impure -f . "$1" | jq -r . } nugetName=$(nixeval "$attr.nupkg.pname") # always skip prerelease versions for now version=$(curl -fsSL "https://api.nuget.org/v3-flatcontainer/$nugetName/index.json" | jq -er '.versions | last(.[] | select(match("^[0-9]+\\.[0-9]+\\.[0-9]+$")))') if [[ $version == $(nixeval "$attr.version") ]]; then echo "$attr" is already version "$version" exit 0 fi update-source-version "$attr" "$version" --source-key=nupkg.src pkgs/by-name/cs/csharp-ls/package.nix +0 −5 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ lib, buildDotnetGlobalTool, dotnetCorePackages, nix-update-script, }: let inherit (dotnetCorePackages) sdk_8_0; Loading @@ -17,10 +16,6 @@ buildDotnetGlobalTool rec { dotnet-sdk = sdk_8_0; dotnet-runtime = sdk_8_0; passthru = { updateScript = nix-update-script { }; }; meta = { description = "Roslyn-based LSP language server for C#"; mainProgram = "csharp-ls"; Loading pkgs/by-name/cs/csharpier/package.nix +2 −2 Original line number Diff line number Diff line Loading @@ -2,10 +2,10 @@ buildDotnetGlobalTool { pname = "csharpier"; version = "0.29.1"; version = "0.30.2"; executables = "dotnet-csharpier"; nugetHash = "sha256-VW9QzbQfbY3Tz+Gz3hQ7VC4wOtwfIYV1Yq2WJz6bL04="; nugetHash = "sha256-MrpsVlIYyrlu3VvEPcLQRgD2lhfu8ZTN3pUZrZ9nQcA="; meta = with lib; { description = "Opinionated code formatter for C#"; Loading pkgs/by-name/pb/pbm/package.nix +2 −2 Original line number Diff line number Diff line Loading @@ -2,9 +2,9 @@ buildDotnetGlobalTool { pname = "pbm"; version = "1.3.2"; version = "1.4.3"; nugetHash = "sha256-xu3g8NFLZYnHzBuoIhIiAzaPJqY0xhLWLYi+ORRADH8="; nugetHash = "sha256-R6dmF3HPI2BAcNGLCm6WwBlk4ev6T6jaiJUAWYKf2S4="; meta = with lib; { description = "CLI for managing Akka.NET applications and Akka.NET Clusters"; Loading Loading
pkgs/build-support/dotnet/build-dotnet-global-tool/default.nix +79 −53 Original line number Diff line number Diff line { buildDotnetModule, emptyDirectory, fetchNupkg, dotnet-sdk }: { buildDotnetModule, emptyDirectory, fetchNupkg, dotnet-sdk, lib, }: { pname , version fnOrAttrs: buildDotnetModule ( finalAttrs: ( { pname, version, # Name of the nuget package to install, if different from pname , nugetName ? pname nugetName ? pname, # Hash of the nuget package to install, will be given on first build # nugetHash uses SRI hash and should be preferred , nugetHash ? "" , nugetSha256 ? "" nugetHash ? "", nugetSha256 ? "", # Additional nuget deps needed by the tool package , nugetDeps ? (_: []) nugetDeps ? (_: [ ]), # Executables to wrap into `$out/bin`, same as in `buildDotnetModule`, but with # a default of `pname` instead of null, to avoid auto-wrapping everything , executables ? pname executables ? pname, # The dotnet runtime to use, dotnet tools need a full SDK to function , dotnet-runtime ? dotnet-sdk , ... dotnet-runtime ? dotnet-sdk, ... }@args: buildDotnetModule (args // { inherit pname version dotnet-runtime executables; src = emptyDirectory; buildInputs = [ (fetchNupkg { let nupkg = fetchNupkg { pname = nugetName; inherit version; sha256 = nugetSha256; hash = nugetHash; installable = true; }) ]; }; in args // { inherit pname version dotnet-runtime executables ; src = emptyDirectory; buildInputs = [ nupkg ]; dotnetGlobalTool = true; Loading @@ -50,4 +68,12 @@ buildDotnetModule (args // { runHook postInstall ''; }) passthru = { updateScript = ./update.sh; nupkg = nupkg; } // args.passthru or {}; } ) (if lib.isFunction fnOrAttrs then fnOrAttrs finalAttrs else fnOrAttrs) )
pkgs/build-support/dotnet/build-dotnet-global-tool/update.sh 0 → 100755 +24 −0 Original line number Diff line number Diff line #!/usr/bin/env nix-shell #!nix-shell -I nixpkgs=./. -i bash -p curl jq nix common-updater-scripts # shellcheck shell=bash set -euo pipefail attr=$UPDATE_NIX_ATTR_PATH nixeval() { nix --extra-experimental-features nix-command eval --json --impure -f . "$1" | jq -r . } nugetName=$(nixeval "$attr.nupkg.pname") # always skip prerelease versions for now version=$(curl -fsSL "https://api.nuget.org/v3-flatcontainer/$nugetName/index.json" | jq -er '.versions | last(.[] | select(match("^[0-9]+\\.[0-9]+\\.[0-9]+$")))') if [[ $version == $(nixeval "$attr.version") ]]; then echo "$attr" is already version "$version" exit 0 fi update-source-version "$attr" "$version" --source-key=nupkg.src
pkgs/by-name/cs/csharp-ls/package.nix +0 −5 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ lib, buildDotnetGlobalTool, dotnetCorePackages, nix-update-script, }: let inherit (dotnetCorePackages) sdk_8_0; Loading @@ -17,10 +16,6 @@ buildDotnetGlobalTool rec { dotnet-sdk = sdk_8_0; dotnet-runtime = sdk_8_0; passthru = { updateScript = nix-update-script { }; }; meta = { description = "Roslyn-based LSP language server for C#"; mainProgram = "csharp-ls"; Loading
pkgs/by-name/cs/csharpier/package.nix +2 −2 Original line number Diff line number Diff line Loading @@ -2,10 +2,10 @@ buildDotnetGlobalTool { pname = "csharpier"; version = "0.29.1"; version = "0.30.2"; executables = "dotnet-csharpier"; nugetHash = "sha256-VW9QzbQfbY3Tz+Gz3hQ7VC4wOtwfIYV1Yq2WJz6bL04="; nugetHash = "sha256-MrpsVlIYyrlu3VvEPcLQRgD2lhfu8ZTN3pUZrZ9nQcA="; meta = with lib; { description = "Opinionated code formatter for C#"; Loading
pkgs/by-name/pb/pbm/package.nix +2 −2 Original line number Diff line number Diff line Loading @@ -2,9 +2,9 @@ buildDotnetGlobalTool { pname = "pbm"; version = "1.3.2"; version = "1.4.3"; nugetHash = "sha256-xu3g8NFLZYnHzBuoIhIiAzaPJqY0xhLWLYi+ORRADH8="; nugetHash = "sha256-R6dmF3HPI2BAcNGLCm6WwBlk4ev6T6jaiJUAWYKf2S4="; meta = with lib; { description = "CLI for managing Akka.NET applications and Akka.NET Clusters"; Loading