discordchatexporter-cli: Use nuget-to-nix in updater script

+16 -86
+14 -70
pkgs/tools/backup/discordchatexporter-cli/deps.nix
··· 1 { fetchNuGet }: [ 2 - (fetchNuGet { 3 - name = "CliFx"; 4 - version = "2.0.6"; 5 - sha256 = "09yyjgpp52b0r3mqlvx75ld4vjp8hry7ql7r20nnvj0lach6fyh6"; 6 - }) 7 - (fetchNuGet { 8 - name = "Gress"; 9 - version = "1.2.0"; 10 - sha256 = "0aidc9whi0718gh896j7xkyndki9x7rifd8n1n681afb2zbxw4bn"; 11 - }) 12 - (fetchNuGet { 13 - name = "JsonExtensions"; 14 - version = "1.1.0"; 15 - sha256 = "1fqxb2jdbvjgg135wmy890qf63r056dq16jy7wgzkgp21m3j0lgy"; 16 - }) 17 - (fetchNuGet { 18 - name = "Microsoft.AspNetCore.App.Ref"; 19 - version = "3.1.10"; 20 - sha256 = "0xn4zh7shvijqlr03fqsmps6gz856isd9bg9rk4z2c4599ggal77"; 21 - }) 22 - (fetchNuGet { 23 - name = "Microsoft.NETCore.App.Host.linux-x64"; 24 - version = "3.1.14"; 25 - sha256 = "11rqnascx9asfyxgxzwgxgr9gxxndm552k4dn4p1s57ciz7vkg9h"; 26 - }) 27 - (fetchNuGet { 28 - name = "Microsoft.NETCore.App.Ref"; 29 - version = "3.1.0"; 30 - sha256 = "08svsiilx9spvjamcnjswv0dlpdrgryhr3asdz7cvnl914gjzq4y"; 31 - }) 32 - (fetchNuGet { 33 - name = "MiniRazor.CodeGen"; 34 - version = "2.1.4"; 35 - sha256 = "1856hfw2wl3ilxmpg4jmwpigmq0rm50i9pmy3sq8f1xc8j44kzl2"; 36 - }) 37 - (fetchNuGet { 38 - name = "MiniRazor.Runtime"; 39 - version = "2.1.4"; 40 - sha256 = "1pc3kjbnz810a8bb94k6355rflmayigfmpfmc4jzzx6l6iavnnc4"; 41 - }) 42 - (fetchNuGet { 43 - name = "Polly"; 44 - version = "7.2.2"; 45 - sha256 = "0s15n5zwj44i6sw3v40ca8l6j0ijydxcakvad49j52rp49iwrmkn"; 46 - }) 47 - (fetchNuGet { 48 - name = "Spectre.Console"; 49 - version = "0.41.0"; 50 - sha256 = "104vyzwbbq5m75dm31xk7ilvmik8hw1cj3bc301a8w6gq8i0fpk3"; 51 - }) 52 - (fetchNuGet { 53 - name = "Superpower"; 54 - version = "2.3.0"; 55 - sha256 = "0bdsc3c0d6jb0wr67siqfba0ldl0jxbwis6xr0whzqzf6m2cyahm"; 56 - }) 57 - (fetchNuGet { 58 - name = "System.Memory"; 59 - version = "4.5.0"; 60 - sha256 = "1layqpcx1q4l805fdnj2dfqp6ncx2z42ca06rgsr6ikq4jjgbv30"; 61 - }) 62 - (fetchNuGet { 63 - name = "Tyrrrz.Extensions"; 64 - version = "1.6.5"; 65 - sha256 = "1yzsii1pbp6b066wxwwws310p7h809apl81bhb8ad55hqlzy1rg3"; 66 - }) 67 - (fetchNuGet { 68 - name = "Wcwidth"; 69 - version = "0.2.0"; 70 - sha256 = "0p7zaisix9ql4v5nyl9gfc93xcyj74j01rwvgm7jw29js3wlj10s"; 71 - }) 72 ]
··· 1 { fetchNuGet }: [ 2 + (fetchNuGet { name = "CliFx"; version = "2.0.6"; sha256 = "09yyjgpp52b0r3mqlvx75ld4vjp8hry7ql7r20nnvj0lach6fyh6"; }) 3 + (fetchNuGet { name = "Gress"; version = "1.2.0"; sha256 = "0aidc9whi0718gh896j7xkyndki9x7rifd8n1n681afb2zbxw4bn"; }) 4 + (fetchNuGet { name = "JsonExtensions"; version = "1.1.0"; sha256 = "1fqxb2jdbvjgg135wmy890qf63r056dq16jy7wgzkgp21m3j0lgy"; }) 5 + (fetchNuGet { name = "Microsoft.AspNetCore.App.Ref"; version = "3.1.10"; sha256 = "0xn4zh7shvijqlr03fqsmps6gz856isd9bg9rk4z2c4599ggal77"; }) 6 + (fetchNuGet { name = "Microsoft.NETCore.App.Host.linux-x64"; version = "3.1.14"; sha256 = "11rqnascx9asfyxgxzwgxgr9gxxndm552k4dn4p1s57ciz7vkg9h"; }) 7 + (fetchNuGet { name = "Microsoft.NETCore.App.Ref"; version = "3.1.0"; sha256 = "08svsiilx9spvjamcnjswv0dlpdrgryhr3asdz7cvnl914gjzq4y"; }) 8 + (fetchNuGet { name = "MiniRazor.CodeGen"; version = "2.1.4"; sha256 = "1856hfw2wl3ilxmpg4jmwpigmq0rm50i9pmy3sq8f1xc8j44kzl2"; }) 9 + (fetchNuGet { name = "MiniRazor.Runtime"; version = "2.1.4"; sha256 = "1pc3kjbnz810a8bb94k6355rflmayigfmpfmc4jzzx6l6iavnnc4"; }) 10 + (fetchNuGet { name = "Polly"; version = "7.2.2"; sha256 = "0s15n5zwj44i6sw3v40ca8l6j0ijydxcakvad49j52rp49iwrmkn"; }) 11 + (fetchNuGet { name = "Spectre.Console"; version = "0.41.0"; sha256 = "104vyzwbbq5m75dm31xk7ilvmik8hw1cj3bc301a8w6gq8i0fpk3"; }) 12 + (fetchNuGet { name = "Superpower"; version = "2.3.0"; sha256 = "0bdsc3c0d6jb0wr67siqfba0ldl0jxbwis6xr0whzqzf6m2cyahm"; }) 13 + (fetchNuGet { name = "System.Memory"; version = "4.5.0"; sha256 = "1layqpcx1q4l805fdnj2dfqp6ncx2z42ca06rgsr6ikq4jjgbv30"; }) 14 + (fetchNuGet { name = "Tyrrrz.Extensions"; version = "1.6.5"; sha256 = "1yzsii1pbp6b066wxwwws310p7h809apl81bhb8ad55hqlzy1rg3"; }) 15 + (fetchNuGet { name = "Wcwidth"; version = "0.2.0"; sha256 = "0p7zaisix9ql4v5nyl9gfc93xcyj74j01rwvgm7jw29js3wlj10s"; }) 16 ]
+2 -16
pkgs/tools/backup/discordchatexporter-cli/updater.sh
··· 1 #!/usr/bin/env nix-shell 2 - #!nix-shell -i bash -p curl jq common-updater-scripts dotnet-sdk_5 3 set -eo pipefail 4 cd "$(dirname "${BASH_SOURCE[0]}")" 5 ··· 24 mkdir ./nuget_tmp.packages 25 dotnet restore DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj --packages ./nuget_tmp.packages 26 27 - echo "{ fetchNuGet }: [" >"$deps_file" 28 - while read pkg_spec; do 29 - { read pkg_name; read pkg_version; } < <( 30 - # Build version part should be ignored: `3.0.0-beta2.20059.3+77df2220` -> `3.0.0-beta2.20059.3` 31 - sed -nE 's/.*<id>([^<]*).*/\1/p; s/.*<version>([^<+]*).*/\1/p' "$pkg_spec") 32 - pkg_sha256="$(nix-hash --type sha256 --flat --base32 "$(dirname "$pkg_spec")"/*.nupkg)" 33 - cat >>"$deps_file" <<EOF 34 - (fetchNuGet { 35 - name = "$pkg_name"; 36 - version = "$pkg_version"; 37 - sha256 = "$pkg_sha256"; 38 - }) 39 - EOF 40 - done < <(find ./nuget_tmp.packages -name '*.nuspec' | sort) 41 - echo "]" >>"$deps_file" 42 43 popd 44 rm -r "$src"
··· 1 #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p curl jq common-updater-scripts nuget-to-nix dotnet-sdk_5 3 set -eo pipefail 4 cd "$(dirname "${BASH_SOURCE[0]}")" 5 ··· 24 mkdir ./nuget_tmp.packages 25 dotnet restore DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj --packages ./nuget_tmp.packages 26 27 + nuget-to-nix ./nuget_tmp.packages > "$deps_file" 28 29 popd 30 rm -r "$src"