From 73a0342291d330d82e29db7b7fe79390224cf1d6 Mon Sep 17 00:00:00 2001 From: patrick Date: Fri, 31 May 2024 23:33:46 +0000 Subject: [PATCH] Simplify flake (#9) Co-authored-by: Smaug123 <3138005+Smaug123@users.noreply.github.com> Reviewed-on: https://gitea.patrickstevens.co.uk/patrick/anki-static/pulls/9 --- .config/dotnet-tools.json | 2 +- .woodpecker/.build.yml | 4 +- AnkiStatic.Test/AnkiStatic.Test.fsproj | 12 +- AnkiStatic.Test/TestEndToEnd.fs | 4 +- AnkiStatic.Test/TestJson.fs | 4 +- AnkiStatic/AnkiStatic.fsproj | 4 +- flake.lock | 14 +- flake.nix | 36 +-- nix/deps.nix | 369 +++++-------------------- nix/fetchDeps.sh | 73 ----- 10 files changed, 88 insertions(+), 434 deletions(-) delete mode 100644 nix/fetchDeps.sh diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 9e89cf8..e27e810 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "fantomas": { - "version": "6.2.0", + "version": "6.3.4", "commands": [ "fantomas" ] diff --git a/.woodpecker/.build.yml b/.woodpecker/.build.yml index 865800d..310e74a 100644 --- a/.woodpecker/.build.yml +++ b/.woodpecker/.build.yml @@ -11,8 +11,8 @@ # Test "nix build", "nix run . -- verify AnkiStatic.Test/CapitalsOfTheWorld.json", - "nix develop --command dotnet -- test", - "nix develop --command dotnet -- test --configuration Release" + "nix develop --command dotnet test", + "nix develop --command dotnet test --configuration Release" ], "when": [ { "event": "push", "evaluate": "CI_COMMIT_BRANCH == CI_REPO_DEFAULT_BRANCH" }, diff --git a/AnkiStatic.Test/AnkiStatic.Test.fsproj b/AnkiStatic.Test/AnkiStatic.Test.fsproj index d861cbf..f319729 100644 --- a/AnkiStatic.Test/AnkiStatic.Test.fsproj +++ b/AnkiStatic.Test/AnkiStatic.Test.fsproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false true @@ -18,12 +18,10 @@ - - - - - - + + + + diff --git a/AnkiStatic.Test/TestEndToEnd.fs b/AnkiStatic.Test/TestEndToEnd.fs index 4d89aca..86ad8c6 100644 --- a/AnkiStatic.Test/TestEndToEnd.fs +++ b/AnkiStatic.Test/TestEndToEnd.fs @@ -7,9 +7,7 @@ open System.IO [] module TestEndToEnd = - type private Dummy = - class - end + type private Dummy = class end [] [] diff --git a/AnkiStatic.Test/TestJson.fs b/AnkiStatic.Test/TestJson.fs index cf192b7..ded7f74 100644 --- a/AnkiStatic.Test/TestJson.fs +++ b/AnkiStatic.Test/TestJson.fs @@ -7,9 +7,7 @@ open FsUnitTyped [] module TestJson = - type private Dummy = - class - end + type private Dummy = class end [] let ``Can read example`` () = diff --git a/AnkiStatic/AnkiStatic.fsproj b/AnkiStatic/AnkiStatic.fsproj index b98bcef..3835d26 100644 --- a/AnkiStatic/AnkiStatic.fsproj +++ b/AnkiStatic/AnkiStatic.fsproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 @@ -21,7 +21,7 @@ - + diff --git a/flake.lock b/flake.lock index a464c64..6d3fb55 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1692799911, - "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1694021185, - "narHash": "sha256-v5Ie83yfsiQgp4GDRZFIsbkctEynfOdNOi67vBH12XM=", + "lastModified": 1717188610, + "narHash": "sha256-jXjxTtnbyfF/V8KrLMTOMNRfVq337HopHlJUfnsQIUQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3e233330d9f88f78c75c2a164a50807e44245007", + "rev": "158f2a4c46db4d32df9c61ebf7fdbb14073bd70b", "type": "github" }, "original": { @@ -57,4 +57,4 @@ }, "root": "root", "version": 7 -} \ No newline at end of file +} diff --git a/flake.nix b/flake.nix index 76a4cdb..1d38c11 100644 --- a/flake.nix +++ b/flake.nix @@ -16,9 +16,9 @@ pkgs = nixpkgs.legacyPackages.${system}; projectFile = "./AnkiStatic/AnkiStatic.fsproj"; testProjectFile = "./AnkiStatic.Test/AnkiStatic.Test.fsproj"; - pname = "gitea-repo-config"; - dotnet-sdk = pkgs.dotnet-sdk_7; - dotnet-runtime = pkgs.dotnetCorePackages.runtime_7_0; + pname = "anki-static"; + dotnet-sdk = pkgs.dotnet-sdk_8; + dotnet-runtime = pkgs.dotnetCorePackages.runtime_8_0; version = "0.1"; dotnetTool = toolName: toolVersion: sha256: pkgs.stdenvNoCC.mkDerivation rec { @@ -39,38 +39,16 @@ runHook postInstall ''; }; - fantomas = dotnetTool "fantomas" (builtins.fromJSON (builtins.readFile ./.config/dotnet-tools.json)).tools.fantomas.version "sha256-83RodORaC3rkYfbFMHsYLEtl0+8+akZXcKoSJdgwuUo="; + fantomas = dotnetTool "fantomas" (builtins.fromJSON (builtins.readFile ./.config/dotnet-tools.json)).tools.fantomas.version (builtins.head (builtins.filter (elem: elem.pname == "fantomas") ((import ./nix/deps.nix) {fetchNuGet = x: x;}))).sha256; in { packages = { fantomas = fantomas; - fetchDeps = let - flags = []; - runtimeIds = ["win-x64"] ++ map (system: pkgs.dotnetCorePackages.systemToDotnetRid system) dotnet-sdk.meta.platforms; - in - pkgs.writeShellScriptBin "fetch-${pname}-deps" (builtins.readFile (pkgs.substituteAll { - src = ./nix/fetchDeps.sh; - pname = pname; - binPath = pkgs.lib.makeBinPath [pkgs.coreutils dotnet-sdk (pkgs.nuget-to-nix.override {inherit dotnet-sdk;})]; - projectFiles = toString (pkgs.lib.toList projectFile); - testProjectFiles = toString (pkgs.lib.toList testProjectFile); - rids = pkgs.lib.concatStringsSep "\" \"" runtimeIds; - packages = dotnet-sdk.packages; - storeSrc = pkgs.srcOnly { - src = ./.; - pname = pname; - version = version; - }; - })); default = pkgs.buildDotnetModule { - pname = pname; + inherit pname version projectFile testProjectFile dotnet-sdk dotnet-runtime; name = "anki-static"; - version = version; src = ./.; - projectFile = projectFile; - nugetDeps = ./nix/deps.nix; + nugetDeps = ./nix/deps.nix; # `nix build .#default.passthru.fetch-deps && ./result` and put the result here doCheck = true; - dotnet-sdk = dotnet-sdk; - dotnet-runtime = dotnet-runtime; }; }; apps = { @@ -81,7 +59,7 @@ }; devShells.default = pkgs.mkShell { buildInputs = - [pkgs.alejandra pkgs.dotnet-sdk_7 pkgs.python3] + [pkgs.alejandra dotnet-sdk pkgs.python3] ++ ( if pkgs.stdenv.isDarwin then [pkgs.darwin.apple_sdk.frameworks.CoreServices] diff --git a/nix/deps.nix b/nix/deps.nix index e97ca1c..c414d08 100644 --- a/nix/deps.nix +++ b/nix/deps.nix @@ -1,5 +1,5 @@ # This file was automatically generated by passthru.fetch-deps. -# Please don't edit it manually, your changes might get overwritten! +# Please dont edit it manually, your changes might get overwritten! {fetchNuGet}: [ (fetchNuGet { pname = "Argu"; @@ -7,54 +7,44 @@ sha256 = "1v996g0760qhiys2ahdpnvkldaxr2jn5f1falf789glnk4a6f3xl"; }) (fetchNuGet { - pname = "coverlet.collector"; - version = "3.2.0"; - sha256 = "1qxpv8v10p5wn162lzdm193gdl6c5f81zadj8h889dprlnj3g8yr"; - }) - (fetchNuGet { - pname = "FSharp.Core"; - version = "7.0.300"; - sha256 = "017mp4ndfi9ckps9jczw6d48xm0c2rakf3i5g5f6mimhd1cvlf54"; + pname = "fantomas"; + version = "6.3.4"; + sha256 = "1bf57pzvl0i1bgic2vf08mqlzzbd5kys1ip9klrhm4f155ksm9fm"; }) (fetchNuGet { pname = "FsUnit"; - version = "5.4.0"; - sha256 = "1wvvzlci7kc4hgxfp1dbchwq150zhs029rzgqxgw1nwbgdw1nnix"; + version = "6.0.0"; + sha256 = "18q3p0z155znwj1l0qq3vq9nh9wl2i4mlfx4pmrnia4czr0xdkmb"; + }) + (fetchNuGet { + pname = "Microsoft.AspNetCore.App.Ref"; + version = "7.0.19"; + sha256 = "19pjhnx49srxp1qwknc390gapc44019wy4adz9caxpryw0ch4l1x"; }) (fetchNuGet { pname = "Microsoft.AspNetCore.App.Runtime.linux-arm64"; - version = "7.0.9"; - sha256 = "01nkzvwgrlmgw57llabdgfxqz7jp54a2p3fd83zdlajqmmf54wi5"; + version = "7.0.19"; + sha256 = "0i8mhcy09lmjqhzqmwvp0n5qkizdqin3vap206b2ad28yl6963wz"; }) (fetchNuGet { pname = "Microsoft.AspNetCore.App.Runtime.linux-x64"; - version = "7.0.9"; - sha256 = "12wkvz1mwyxv7zcr18bsyfa93p0wjmxqyz26va34xrfws699ip1v"; + version = "7.0.19"; + sha256 = "1zypq8jgk9z3kn3mmkdijvc9h65iyy7gaif9p0vhnylmvvm89jzp"; }) (fetchNuGet { pname = "Microsoft.AspNetCore.App.Runtime.osx-arm64"; - version = "7.0.9"; - sha256 = "1l3g7l5xzcw3hpk3mcwsl6g72qfrs0m3blazrngma73z4cj3k9bi"; + version = "7.0.19"; + sha256 = "1dqilsqwwymy7fq2pnvjggn5mfvizqsisla0c36w53mg6xx7vn78"; }) (fetchNuGet { pname = "Microsoft.AspNetCore.App.Runtime.osx-x64"; - version = "7.0.9"; - sha256 = "1spnj5n5l0hksrq89blj0xcsp1cnk2dw8n0giqrmq790yssvzn16"; - }) - (fetchNuGet { - pname = "Microsoft.AspNetCore.App.Runtime.win-x64"; - version = "7.0.9"; - sha256 = "0zm2gly0pkm5x0zngcbbz060i2p5xssrb154pnix9xbhpxf9bab7"; + version = "7.0.19"; + sha256 = "1jmg7sxjnsmaa7ag6bgyhndlhvibswcmnrw0n6sr6crw2y0in2a3"; }) (fetchNuGet { pname = "Microsoft.CodeCoverage"; - version = "17.5.0"; - sha256 = "0briw00gb5bz9k9kx00p6ghq47w501db7gb6ig5zzmz9hb8lw4a4"; - }) - (fetchNuGet { - pname = "Microsoft.CSharp"; - version = "4.0.1"; - sha256 = "0zxc0apx1gcx361jlq8smc9pfdgmyjh6hpka8dypc9w23nlsh6yj"; + version = "17.10.0"; + sha256 = "0s0v7jmrq85n356xv7zixvwa4z94fszjcr5vll8x4im1a2lp00f9"; }) (fetchNuGet { pname = "Microsoft.CSharp"; @@ -73,69 +63,59 @@ }) (fetchNuGet { pname = "Microsoft.NET.Test.Sdk"; - version = "17.5.0"; - sha256 = "00gz2i8kx4mlq1ywj3imvf7wc6qzh0bsnynhw06z0mgyha1a21jy"; + version = "17.10.0"; + sha256 = "13g8fwl09li8fc71nk13dgkb7gahd4qhamyg2xby7am63nlchhdf"; }) (fetchNuGet { pname = "Microsoft.NETCore.App.Host.linux-arm64"; - version = "7.0.9"; - sha256 = "1ckgzrwi67prsab6zrjjm0zmf6mbk7wzjjg197nnrjfd6sp5dpq2"; + version = "7.0.19"; + sha256 = "1dv4vk07a7kj53sk1nf63h51swzk9yl4j7jdvkc5w2v0z5a186hm"; }) (fetchNuGet { pname = "Microsoft.NETCore.App.Host.linux-x64"; - version = "7.0.9"; - sha256 = "1rprrl8qbdn9v3j7k2dkh0krmr9bak8k3r5lm9v43f1h85gcicsk"; + version = "7.0.19"; + sha256 = "0jcfmaq4ckcpywwxm1ack9xa001aic8pn85ggglidxgcfdr6mpzd"; + }) + (fetchNuGet { + pname = "Microsoft.NETCore.App.Host.osx-arm64"; + version = "7.0.19"; + sha256 = "0xyc0mdd7nnmc9wjzq8nxwrqagmiqxds8qwghr2rgxw55b9slc33"; }) (fetchNuGet { pname = "Microsoft.NETCore.App.Host.osx-x64"; - version = "7.0.9"; - sha256 = "0vgn0gd31xfk4j7a8grnnbn3sc8afbncxzcfykzlrpqmzn61plvm"; + version = "7.0.19"; + sha256 = "1srx048x6nv88s308bfn2vsg9gyqvzmgn4xlzknm9yr89c5pm96q"; }) (fetchNuGet { - pname = "Microsoft.NETCore.App.Host.win-x64"; - version = "7.0.9"; - sha256 = "0dbwkh60f4sbfxsfzi5kyhc7aiz6f9bx3p0m5h897pp94xz7gqrl"; + pname = "Microsoft.NETCore.App.Ref"; + version = "7.0.19"; + sha256 = "1z9zfzccqn6yh9mcqrkiidjagzmnk4blrralzb8q0b7mnf1b1ww9"; }) (fetchNuGet { pname = "Microsoft.NETCore.App.Runtime.linux-arm64"; - version = "7.0.9"; - sha256 = "0d380v98ncgbjzhrd3pf6ff2155rbl173sr686ifs8djl1w86q24"; + version = "7.0.19"; + sha256 = "0m30aykrzl48i8589qn8z89hm9p1yl71cdigv1f09fmwb7c6jfm3"; }) (fetchNuGet { pname = "Microsoft.NETCore.App.Runtime.linux-x64"; - version = "7.0.9"; - sha256 = "15fw7ywbn28asnn6d23rl5bljzx6crxq8nj0iv7l24c96l41pi55"; + version = "7.0.19"; + sha256 = "12zgh8pvbdl99zs0rq5ajbl91r976i47hdrrvxl2hbsxl2ws3brs"; }) (fetchNuGet { pname = "Microsoft.NETCore.App.Runtime.osx-arm64"; - version = "7.0.9"; - sha256 = "1cw4cm7hr4x3niynbxc0z4lwn8lmd78x00vmb1kq52gvy24vnpvz"; + version = "7.0.19"; + sha256 = "08gs703rz3agmisy3vsdnyv5lyc32qb8kvfljzszbyqlaf5cxhd1"; }) (fetchNuGet { pname = "Microsoft.NETCore.App.Runtime.osx-x64"; - version = "7.0.9"; - sha256 = "0k5iqm0hq9f9nwq9sazld3ada7zx2wypcf5k2ddhrwr53wr3rb2v"; - }) - (fetchNuGet { - pname = "Microsoft.NETCore.App.Runtime.win-x64"; - version = "7.0.9"; - sha256 = "1lxn13pvg2zynwnzxriw6izdq778w004m5ijxircn1mhzrziipz9"; - }) - (fetchNuGet { - pname = "Microsoft.NETCore.Platforms"; - version = "1.0.1"; - sha256 = "01al6cfxp68dscl15z7rxfw9zvhm64dncsw09a1vmdkacsa2v6lr"; + version = "7.0.19"; + sha256 = "1lwnwxscza5m7pk83fwjz5r9kms3ybag2rl07f3gqp3b203iyyxx"; }) (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "1.1.0"; sha256 = "08vh1r12g6ykjygq5d3vq09zylgb84l63k49jc4v8faw9g93iqqm"; }) - (fetchNuGet { - pname = "Microsoft.NETCore.Targets"; - version = "1.0.1"; - sha256 = "0ppdkwy6s9p7x9jix3v4402wb171cdiibq7js7i13nxpdky7074p"; - }) (fetchNuGet { pname = "Microsoft.NETCore.Targets"; version = "1.1.0"; @@ -143,23 +123,18 @@ }) (fetchNuGet { pname = "Microsoft.TestPlatform.ObjectModel"; - version = "17.5.0"; - sha256 = "0qkjyf3ky6xpjg5is2sdsawm99ka7fzgid2bvpglwmmawqgm8gls"; + version = "17.10.0"; + sha256 = "07j69cw8r39533w4p39mnj00kahazz38760in3jfc45kmlcdb26x"; }) (fetchNuGet { pname = "Microsoft.TestPlatform.TestHost"; - version = "17.5.0"; - sha256 = "17g0k3r5n8grba8kg4nghjyhnq9w8v0w6c2nkyyygvfh8k8x9wh3"; + version = "17.10.0"; + sha256 = "1bl471s7fx9jycr0cc8rylwf34mrvlg9qn1an6l86nisavfcyb7v"; }) (fetchNuGet { pname = "Namotion.Reflection"; - version = "2.1.2"; - sha256 = "17hg2vbd1lv8d1igl978a9ndsnkclb32ljrkq4qp0vf796n8dcy8"; - }) - (fetchNuGet { - pname = "NETStandard.Library"; - version = "2.0.0"; - sha256 = "1bc4ba8ahgk15m8k4nd7x406nhi0kwqzbgjk2dmw52ss553xz7iy"; + version = "3.1.1"; + sha256 = "0795dqgbjqy59dxb8299kxxp3klnd7pac7hsr6xv8j69kbzd6war"; }) (fetchNuGet { pname = "Newtonsoft.Json"; @@ -168,49 +143,34 @@ }) (fetchNuGet { pname = "Newtonsoft.Json"; - version = "9.0.1"; - sha256 = "0mcy0i7pnfpqm4pcaiyzzji4g0c8i3a5gjz28rrr28110np8304r"; + version = "13.0.3"; + sha256 = "0xrwysmrn4midrjal8g2hr1bbg38iyisl0svamb11arqws4w2bw7"; }) (fetchNuGet { pname = "NJsonSchema"; - version = "10.9.0"; - sha256 = "151vgcx7vl3mqjl5jdqz4vvd0fyrl90cgj1r6a535xr43ycxj4zd"; + version = "11.0.0"; + sha256 = "02n7sqqwcwwn8d05zr88axb8x1wj7f80ahx370npm59s8vgy5brh"; }) (fetchNuGet { - pname = "NuGet.Frameworks"; - version = "5.11.0"; - sha256 = "0wv26gq39hfqw9md32amr5771s73f5zn1z9vs4y77cgynxr73s4z"; + pname = "NJsonSchema.Annotations"; + version = "11.0.0"; + sha256 = "1b7zpsbipn5w2fxncidgy3yzvbi5kf3yvx4lrr1hyrvq7wx9clq1"; }) (fetchNuGet { pname = "NUnit"; - version = "3.13.3"; - sha256 = "0wdzfkygqnr73s6lpxg5b1pwaqz9f414fxpvpdmf72bvh4jaqzv6"; - }) - (fetchNuGet { - pname = "NUnit.Analyzers"; - version = "3.6.1"; - sha256 = "16dw5375k2wyhiw9x387y7pjgq6zms30y036qb8z7idx4lxw9yi9"; + version = "4.1.0"; + sha256 = "0fj6xwgqaxq3mrai86bklclfmjkzf038mrslwfqf4ignaz9f7g5j"; }) (fetchNuGet { pname = "NUnit3TestAdapter"; - version = "4.4.2"; - sha256 = "1n2jlc16vjdd81cb1by4qbp75sq73zsjz5w3zc61ssmbdci1q2ri"; + version = "4.5.0"; + sha256 = "1srx1629s0k1kmf02nmz251q07vj6pv58mdafcr5dr0bbn1fh78i"; }) (fetchNuGet { pname = "runtime.any.System.Collections"; version = "4.3.0"; sha256 = "0bv5qgm6vr47ynxqbnkc7i797fdi8gbjjxii173syrx14nmrkwg0"; }) - (fetchNuGet { - pname = "runtime.any.System.Diagnostics.Tools"; - version = "4.3.0"; - sha256 = "1wl76vk12zhdh66vmagni66h5xbhgqq7zkdpgw21jhxhvlbcl8pk"; - }) - (fetchNuGet { - pname = "runtime.any.System.Diagnostics.Tracing"; - version = "4.3.0"; - sha256 = "00j6nv2xgmd3bi347k00m7wr542wjlig53rmj28pmw7ddcn97jbn"; - }) (fetchNuGet { pname = "runtime.any.System.Globalization"; version = "4.3.0"; @@ -261,11 +221,6 @@ version = "4.3.0"; sha256 = "0aqqi1v4wx51h51mk956y783wzags13wa7mgqyclacmsmpv02ps3"; }) - (fetchNuGet { - pname = "runtime.any.System.Text.Encoding.Extensions"; - version = "4.3.0"; - sha256 = "0lqhgqi0i8194ryqq6v2gqx0fb86db2gqknbm0aq31wb378j7ip8"; - }) (fetchNuGet { pname = "runtime.any.System.Threading.Tasks"; version = "4.3.0"; @@ -336,11 +291,6 @@ version = "4.3.0"; sha256 = "1lps7fbnw34bnh3lm31gs5c0g0dh7548wfmb8zz62v0zqz71msj5"; }) - (fetchNuGet { - pname = "runtime.unix.System.IO.FileSystem"; - version = "4.3.0"; - sha256 = "14nbkhvs7sji5r1saj2x8daz82rnf9kx28d3v2qss34qbr32dzix"; - }) (fetchNuGet { pname = "runtime.unix.System.Private.Uri"; version = "4.3.0"; @@ -351,21 +301,6 @@ version = "4.3.0"; sha256 = "0pnxxmm8whx38dp6yvwgmh22smknxmqs5n513fc7m4wxvs1bvi4p"; }) - (fetchNuGet { - pname = "runtime.win.System.Diagnostics.Debug"; - version = "4.3.0"; - sha256 = "16fbn4bcynad1ygdq0yk1wmckvs8jvrrf104xa5dc2hlc8y3x58f"; - }) - (fetchNuGet { - pname = "runtime.win.System.IO.FileSystem"; - version = "4.3.0"; - sha256 = "1c01nklbxywszsbfaxc76hsz7gdxac3jkphrywfkdsi3v4bwd6g8"; - }) - (fetchNuGet { - pname = "runtime.win.System.Runtime.Extensions"; - version = "4.3.0"; - sha256 = "1700famsxndccfbcdz9q14qb20p49lax67mqwpgy4gx3vja1yczr"; - }) (fetchNuGet { pname = "SQLitePCLRaw.bundle_e_sqlite3"; version = "2.1.4"; @@ -386,16 +321,6 @@ version = "2.1.4"; sha256 = "0b8f51nrjkq0pmfzjaqk5rp7r0cp2lbdm2whynj3xsjklppzmn35"; }) - (fetchNuGet { - pname = "System.Buffers"; - version = "4.3.0"; - sha256 = "0fgns20ispwrfqll4q1zc1waqcmylb3zc50ys9x8zlwxh9pmd9jy"; - }) - (fetchNuGet { - pname = "System.Collections"; - version = "4.0.11"; - sha256 = "1ga40f5lrwldiyw6vy67d0sg7jd7ww6kgwbksm19wrvq9hr0bsm6"; - }) (fetchNuGet { pname = "System.Collections"; version = "4.3.0"; @@ -406,81 +331,31 @@ version = "4.4.0"; sha256 = "1hjgmz47v5229cbzd2pwz2h0dkq78lb2wp9grx8qr72pb5i0dk7v"; }) - (fetchNuGet { - pname = "System.Diagnostics.Debug"; - version = "4.0.11"; - sha256 = "0gmjghrqmlgzxivd2xl50ncbglb7ljzb66rlx8ws6dv8jm0d5siz"; - }) (fetchNuGet { pname = "System.Diagnostics.Debug"; version = "4.3.0"; sha256 = "00yjlf19wjydyr6cfviaph3vsjzg3d5nvnya26i2fvfg53sknh3y"; }) - (fetchNuGet { - pname = "System.Diagnostics.Tools"; - version = "4.0.1"; - sha256 = "19cknvg07yhakcvpxg3cxa0bwadplin6kyxd8mpjjpwnp56nl85x"; - }) - (fetchNuGet { - pname = "System.Diagnostics.Tracing"; - version = "4.3.0"; - sha256 = "1m3bx6c2s958qligl67q7grkwfz3w53hpy7nc97mh6f7j5k168c4"; - }) - (fetchNuGet { - pname = "System.Dynamic.Runtime"; - version = "4.0.11"; - sha256 = "1pla2dx8gkidf7xkciig6nifdsb494axjvzvann8g2lp3dbqasm9"; - }) (fetchNuGet { pname = "System.Dynamic.Runtime"; version = "4.3.0"; sha256 = "1d951hrvrpndk7insiag80qxjbf2y0y39y8h5hnq9612ws661glk"; }) - (fetchNuGet { - pname = "System.Globalization"; - version = "4.0.11"; - sha256 = "070c5jbas2v7smm660zaf1gh0489xanjqymkvafcs4f8cdrs1d5d"; - }) (fetchNuGet { pname = "System.Globalization"; version = "4.3.0"; sha256 = "1cp68vv683n6ic2zqh2s1fn4c2sd87g5hpp6l4d4nj4536jz98ki"; }) - (fetchNuGet { - pname = "System.IO"; - version = "4.1.0"; - sha256 = "1g0yb8p11vfd0kbkyzlfsbsp5z44lwsvyc0h3dpw6vqnbi035ajp"; - }) (fetchNuGet { pname = "System.IO"; version = "4.3.0"; sha256 = "05l9qdrzhm4s5dixmx68kxwif4l99ll5gqmh7rqgw554fx0agv5f"; }) - (fetchNuGet { - pname = "System.IO.FileSystem"; - version = "4.0.1"; - sha256 = "0kgfpw6w4djqra3w5crrg8xivbanh1w9dh3qapb28q060wb9flp1"; - }) - (fetchNuGet { - pname = "System.IO.FileSystem.Primitives"; - version = "4.0.1"; - sha256 = "1s0mniajj3lvbyf7vfb5shp4ink5yibsx945k6lvxa96r8la1612"; - }) - (fetchNuGet { - pname = "System.Linq"; - version = "4.1.0"; - sha256 = "1ppg83svb39hj4hpp5k7kcryzrf3sfnm08vxd5sm2drrijsla2k5"; - }) (fetchNuGet { pname = "System.Linq"; version = "4.3.0"; sha256 = "1w0gmba695rbr80l1k2h4mrwzbzsyfl2z4klmpbsvsg5pm4a56s7"; }) - (fetchNuGet { - pname = "System.Linq.Expressions"; - version = "4.1.0"; - sha256 = "1gpdxl6ip06cnab7n3zlcg6mqp7kknf73s8wjinzi4p0apw82fpg"; - }) (fetchNuGet { pname = "System.Linq.Expressions"; version = "4.3.0"; @@ -491,11 +366,6 @@ version = "4.5.3"; sha256 = "0naqahm3wljxb5a911d37mwjqjdxv9l0b49p5dmfyijvni2ppy8a"; }) - (fetchNuGet { - pname = "System.ObjectModel"; - version = "4.0.12"; - sha256 = "1sybkfi60a4588xn34nd9a58png36i0xr4y4v4kqpg8wlvy5krrj"; - }) (fetchNuGet { pname = "System.ObjectModel"; version = "4.3.0"; @@ -506,51 +376,26 @@ version = "4.3.0"; sha256 = "04r1lkdnsznin0fj4ya1zikxiqr0h6r6a1ww2dsm60gqhdrf0mvx"; }) - (fetchNuGet { - pname = "System.Reflection"; - version = "4.1.0"; - sha256 = "1js89429pfw79mxvbzp8p3q93il6rdff332hddhzi5wqglc4gml9"; - }) (fetchNuGet { pname = "System.Reflection"; version = "4.3.0"; sha256 = "0xl55k0mw8cd8ra6dxzh974nxif58s3k1rjv1vbd7gjbjr39j11m"; }) - (fetchNuGet { - pname = "System.Reflection.Emit"; - version = "4.0.1"; - sha256 = "0ydqcsvh6smi41gyaakglnv252625hf29f7kywy2c70nhii2ylqp"; - }) (fetchNuGet { pname = "System.Reflection.Emit"; version = "4.3.0"; sha256 = "11f8y3qfysfcrscjpjym9msk7lsfxkk4fmz9qq95kn3jd0769f74"; }) - (fetchNuGet { - pname = "System.Reflection.Emit.ILGeneration"; - version = "4.0.1"; - sha256 = "1pcd2ig6bg144y10w7yxgc9d22r7c7ww7qn1frdfwgxr24j9wvv0"; - }) (fetchNuGet { pname = "System.Reflection.Emit.ILGeneration"; version = "4.3.0"; sha256 = "0w1n67glpv8241vnpz1kl14sy7zlnw414aqwj4hcx5nd86f6994q"; }) - (fetchNuGet { - pname = "System.Reflection.Emit.Lightweight"; - version = "4.0.1"; - sha256 = "1s4b043zdbx9k39lfhvsk68msv1nxbidhkq6nbm27q7sf8xcsnxr"; - }) (fetchNuGet { pname = "System.Reflection.Emit.Lightweight"; version = "4.3.0"; sha256 = "0ql7lcakycrvzgi9kxz1b3lljd990az1x6c4jsiwcacrvimpib5c"; }) - (fetchNuGet { - pname = "System.Reflection.Extensions"; - version = "4.0.1"; - sha256 = "0m7wqwq0zqq9gbpiqvgk3sr92cbrw7cp3xn53xvw7zj6rz6fdirn"; - }) (fetchNuGet { pname = "System.Reflection.Extensions"; version = "4.3.0"; @@ -561,149 +406,59 @@ version = "1.6.0"; sha256 = "1wdbavrrkajy7qbdblpbpbalbdl48q3h34cchz24gvdgyrlf15r4"; }) - (fetchNuGet { - pname = "System.Reflection.Primitives"; - version = "4.0.1"; - sha256 = "1bangaabhsl4k9fg8khn83wm6yial8ik1sza7401621jc6jrym28"; - }) (fetchNuGet { pname = "System.Reflection.Primitives"; version = "4.3.0"; sha256 = "04xqa33bld78yv5r93a8n76shvc8wwcdgr1qvvjh959g3rc31276"; }) - (fetchNuGet { - pname = "System.Reflection.TypeExtensions"; - version = "4.1.0"; - sha256 = "1bjli8a7sc7jlxqgcagl9nh8axzfl11f4ld3rjqsyxc516iijij7"; - }) (fetchNuGet { pname = "System.Reflection.TypeExtensions"; version = "4.3.0"; sha256 = "0y2ssg08d817p0vdag98vn238gyrrynjdj4181hdg780sif3ykp1"; }) - (fetchNuGet { - pname = "System.Resources.ResourceManager"; - version = "4.0.1"; - sha256 = "0b4i7mncaf8cnai85jv3wnw6hps140cxz8vylv2bik6wyzgvz7bi"; - }) (fetchNuGet { pname = "System.Resources.ResourceManager"; version = "4.3.0"; sha256 = "0sjqlzsryb0mg4y4xzf35xi523s4is4hz9q4qgdvlvgivl7qxn49"; }) - (fetchNuGet { - pname = "System.Runtime"; - version = "4.1.0"; - sha256 = "02hdkgk13rvsd6r9yafbwzss8kr55wnj8d5c7xjnp8gqrwc8sn0m"; - }) (fetchNuGet { pname = "System.Runtime"; version = "4.3.0"; sha256 = "066ixvgbf2c929kgknshcxqj6539ax7b9m570cp8n179cpfkapz7"; }) - (fetchNuGet { - pname = "System.Runtime.Extensions"; - version = "4.1.0"; - sha256 = "0rw4rm4vsm3h3szxp9iijc3ksyviwsv6f63dng3vhqyg4vjdkc2z"; - }) (fetchNuGet { pname = "System.Runtime.Extensions"; version = "4.3.0"; sha256 = "1ykp3dnhwvm48nap8q23893hagf665k0kn3cbgsqpwzbijdcgc60"; }) - (fetchNuGet { - pname = "System.Runtime.Handles"; - version = "4.0.1"; - sha256 = "1g0zrdi5508v49pfm3iii2hn6nm00bgvfpjq1zxknfjrxxa20r4g"; - }) (fetchNuGet { pname = "System.Runtime.Handles"; version = "4.3.0"; sha256 = "0sw2gfj2xr7sw9qjn0j3l9yw07x73lcs97p8xfc9w1x9h5g5m7i8"; }) - (fetchNuGet { - pname = "System.Runtime.InteropServices"; - version = "4.1.0"; - sha256 = "01kxqppx3dr3b6b286xafqilv4s2n0gqvfgzfd4z943ga9i81is1"; - }) (fetchNuGet { pname = "System.Runtime.InteropServices"; version = "4.3.0"; sha256 = "00hywrn4g7hva1b2qri2s6rabzwgxnbpw9zfxmz28z09cpwwgh7j"; }) - (fetchNuGet { - pname = "System.Runtime.Serialization.Primitives"; - version = "4.1.1"; - sha256 = "042rfjixknlr6r10vx2pgf56yming8lkjikamg3g4v29ikk78h7k"; - }) (fetchNuGet { pname = "System.Security.Cryptography.ProtectedData"; version = "4.4.0"; sha256 = "1q8ljvqhasyynp94a1d7jknk946m20lkwy2c3wa8zw2pc517fbj6"; }) - (fetchNuGet { - pname = "System.Text.Encoding"; - version = "4.0.11"; - sha256 = "1dyqv0hijg265dwxg6l7aiv74102d6xjiwplh2ar1ly6xfaa4iiw"; - }) (fetchNuGet { pname = "System.Text.Encoding"; version = "4.3.0"; sha256 = "1f04lkir4iladpp51sdgmis9dj4y8v08cka0mbmsy0frc9a4gjqr"; }) - (fetchNuGet { - pname = "System.Text.Encoding.Extensions"; - version = "4.0.11"; - sha256 = "08nsfrpiwsg9x5ml4xyl3zyvjfdi4mvbqf93kjdh11j4fwkznizs"; - }) - (fetchNuGet { - pname = "System.Text.RegularExpressions"; - version = "4.1.0"; - sha256 = "1mw7vfkkyd04yn2fbhm38msk7dz2xwvib14ygjsb8dq2lcvr18y7"; - }) - (fetchNuGet { - pname = "System.Threading"; - version = "4.0.11"; - sha256 = "19x946h926bzvbsgj28csn46gak2crv2skpwsx80hbgazmkgb1ls"; - }) (fetchNuGet { pname = "System.Threading"; version = "4.3.0"; sha256 = "0rw9wfamvhayp5zh3j7p1yfmx9b5khbf4q50d8k5rk993rskfd34"; }) - (fetchNuGet { - pname = "System.Threading.Overlapped"; - version = "4.3.0"; - sha256 = "1nahikhqh9nk756dh8p011j36rlcp1bzz3vwi2b4m1l2s3vz8idm"; - }) - (fetchNuGet { - pname = "System.Threading.Tasks"; - version = "4.0.11"; - sha256 = "0nr1r41rak82qfa5m0lhk9mp0k93bvfd7bbd9sdzwx9mb36g28p5"; - }) (fetchNuGet { pname = "System.Threading.Tasks"; version = "4.3.0"; sha256 = "134z3v9abw3a6jsw17xl3f6hqjpak5l682k2vz39spj4kmydg6k7"; }) - (fetchNuGet { - pname = "System.Threading.Tasks.Extensions"; - version = "4.0.0"; - sha256 = "1cb51z062mvc2i8blpzmpn9d9mm4y307xrwi65di8ri18cz5r1zr"; - }) - (fetchNuGet { - pname = "System.Xml.ReaderWriter"; - version = "4.0.11"; - sha256 = "0c6ky1jk5ada9m94wcadih98l6k1fvf6vi7vhn1msjixaha419l5"; - }) - (fetchNuGet { - pname = "System.Xml.XDocument"; - version = "4.0.11"; - sha256 = "0n4lvpqzy9kc7qy1a4acwwd7b7pnvygv895az5640idl2y9zbz18"; - }) - (fetchNuGet { - pname = "fantomas"; - version = "6.2.0"; - sha256 = "sha256-83RodORaC3rkYfbFMHsYLEtl0+8+akZXcKoSJdgwuUo="; - }) ] diff --git a/nix/fetchDeps.sh b/nix/fetchDeps.sh deleted file mode 100644 index e15b822..0000000 --- a/nix/fetchDeps.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -# This file was adapted from -# https://github.com/NixOS/nixpkgs/blob/b981d811453ab84fb3ea593a9b33b960f1ab9147/pkgs/build-support/dotnet/build-dotnet-module/default.nix#L173 -set -euo pipefail -export PATH="@binPath@" -for arg in "$@"; do - case "$arg" in - --keep-sources|-k) - keepSources=1 - shift - ;; - --help|-h) - echo "usage: $0 [--keep-sources] [--help] " - echo " The path to write the lockfile to. A temporary file is used if this is not set" - echo " --keep-sources Don't remove temporary directories upon exit, useful for debugging" - echo " --help Show this help message" - exit - ;; - esac -done -tmp=$(mktemp -td "@pname@-tmp-XXXXXX") -export tmp -HOME=$tmp/home -exitTrap() { - test -n "${ranTrap-}" && return - ranTrap=1 - if test -n "${keepSources-}"; then - echo -e "Path to the source: $tmp/src\nPath to the fake home: $tmp/home" - else - rm -rf "$tmp" - fi - # Since mktemp is used this will be empty if the script didnt succesfully complete - if ! test -s "$depsFile"; then - rm -rf "$depsFile" - fi -} -trap exitTrap EXIT INT TERM -dotnetRestore() { - local -r project="${1-}" - local -r rid="$2" - dotnet restore "${project-}" \ - -p:ContinuousIntegrationBuild=true \ - -p:Deterministic=true \ - --packages "$tmp/nuget_pkgs" \ - --runtime "$rid" \ - --no-cache \ - --force -} -declare -a projectFiles=( @projectFiles@ ) -declare -a testProjectFiles=( @testProjectFiles@ ) -export DOTNET_NOLOGO=1 -export DOTNET_CLI_TELEMETRY_OPTOUT=1 -depsFile=$(realpath "${1:-$(mktemp -t "@pname@-deps-XXXXXX.nix")}") -mkdir -p "$tmp/nuget_pkgs" -storeSrc="@storeSrc@" -src="$tmp/src" -cp -rT "$storeSrc" "$src" -chmod -R +w "$src" -cd "$src" -echo "Restoring project..." -rids=("@rids@") -for rid in "${rids[@]}"; do - (( ${#projectFiles[@]} == 0 )) && dotnetRestore "" "$rid" - for project in "${projectFiles[@]-}" "${testProjectFiles[@]-}"; do - dotnetRestore "$project" "$rid" - done -done -echo "Successfully restored project" -echo "Writing lockfile..." -echo -e "# This file was automatically generated by passthru.fetch-deps.\n# Please don't edit it manually, your changes might get overwritten!\n" > "$depsFile" -nuget-to-nix "$tmp/nuget_pkgs" "@packages@" >> "$depsFile" -echo "Successfully wrote lockfile to $depsFile"