| 24 Oct 2025 |
Manuel Bärenz | Either way this is what I have right now:
{
lib,
dotnetCorePackages,
makeWrapper,
stdenvNoCC,
}:
let
url = "${customNugetServer}(Id='${pname}',Version='${version}')/Download";
dlls = dotnetCorePackages.fetchNupkg {
inherit url version pname;
sha256 = "sha256-xEPmYA0wkQrDBl82HDa6khIMltNUV5gdzayt6J1Lwpw=";
};
in
with dotnetCorePackages;
buildDotnetModule {
inherit pname version;
src = webapi-src;
buildInputs = [
aspnetcore_9_0
dlls
];
dotnet-sdk = sdk_9_0;
dotnet-runtime = runtime_9_0;
}
| 13:19:08 |
Manuel Bärenz | And it gets me this far:
> Running phase: configureNuget
> The template "NuGet Config" was created successfully.
>
> Processing post-creation actions...
>
>
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: configurePhase
> Executing dotnetConfigureHook
> Determining projects to restore...
> /build/myAPI/myApi.csproj : error NU1101: Unable to find package Swashbuckle.AspNetCore. No packages exist with this id in source(s): _nix
| 13:20:12 |
Manuel Bärenz | I would have thought that the package is part of aspnet, but either it isn't or I'm adding dependencies incorrectly | 13:20:42 |
Corngood | You probably need to add nuget deps: nugetDeps = ./deps.json, and then run $(nix-build -A [pkg].fetch-deps) | 13:23:59 |
Corngood | Also putting aspnetcore_9_0 in buildInputs is unusual. You might just want to use it for dotnet-runtime. | 13:26:10 |
Manuel Bärenz | That seems like some great piece of tooling. Right now it fails because of some proprietary dependency from our partner, but it did download a bunch of packages that seemed sensible | 13:32:39 |
Manuel Bärenz |
That seems like some great piece of tooling.
Sorry, that sounded sarcastic, I meant it seriously 😅 and thanks for your help so far
| 13:41:53 |
Manuel Bärenz | Can I point the fetch-deps to a custom nuget server for some packages? Or at least pass it a NuGet.config that has the custom server configured? | 13:46:14 |
Manuel Bärenz | Ohh. I think if I name it properly (nuget.config instead of NuGet.config) it detects it automatically. | 13:53:13 |
Corngood | Did you get a complete deps.json then? | 14:09:51 |
| 27 Oct 2025 |
Manuel Bärenz | No, the fetcher failed and didn't create a deps.json. I'll try again soon when I get the complete closed source dependencies from our partner | 08:32:51 |
| 2 Nov 2025 |
Emma [it/its] | question, how do i use the fetchdeps thing with the nix cli? | 19:31:00 |
Emma [it/its] | doing a nix build .\#thing.passthru.fetch-deps && ./result fails with this:
/nix/store/q38z0zig1346h47vyianirr25fi9g42m-fetch-deps.sh: line 10: /nix/store/rxf86xrfxhij48hjqgysi8blj2c9hg88-source/ArcaneLibs.Blazor.Components/deps.nix: Read-only file system
| 19:31:45 |
Corngood | In reply to @emma:rory.gay
doing a nix build .\#thing.passthru.fetch-deps && ./result fails with this:
/nix/store/q38z0zig1346h47vyianirr25fi9g42m-fetch-deps.sh: line 10: /nix/store/rxf86xrfxhij48hjqgysi8blj2c9hg88-source/ArcaneLibs.Blazor.Components/deps.nix: Read-only file system
You can't use .# because that'll be a read-only copy. Try -f . instead | 19:33:03 |
Emma [it/its] | oh apparently you can just pass a path... lol | 19:33:05 |
Emma [it/its] | that fails because i dont have a default.nix... lol | 19:33:38 |
Corngood | You can pass a .nix file path instead of . | 19:34:14 |
Emma [it/its] | i have a flake.nix | 19:34:26 |
Emma [it/its] | thats the only .nix file i have | 19:34:29 |
Emma [it/its] | (i dont want to maintain 6 identical copies of the same file when they only differ in at most 2 lines) | 19:35:22 |
Corngood | Oh, you can also pass a path to fetch-deps itself to override it. That might be easiest | 19:35:27 |
Emma [it/its] | yep discovered that one already | 19:35:38 |
Emma [it/its] | but i guess that's my best bet | 19:35:44 |
Corngood | Yeah otherwise you need to do an impure eval, maybe using flake compat or something. Passing the path is probably easiest. | 19:37:12 |
Emma [it/its] | hm, i wonder what the best way would be to use nix to publish nuget packages | 19:53:00 |
Emma [it/its] | since packNupkg emits multiple nupkg files, im not sure how ot best deal with thta | 19:53:31 |
Emma [it/its] | ┏━ Dependency Graph with 6 roots:
┃ ✔ ArcaneLibs.Blazor.Components-v1-1 ⏱ 12s
┃ ✔ ArcaneLibs.Logging-v1-1 ⏱ 12s
┃ ✔ ArcaneLibs.Timings-v1-1 ⏱ 12s
┃ ✔ ArcaneLibs-v1-1 ⏱ 12s
┃ ✔ ArcaneLibs.StringNormalisation-v1-1 ⏱ 12s
┃ ✔ ArcaneLibs.Legacy-v1-1 ⏱ 12s
┣━━━ Builds
┗━ ∑ ⏵ 0 │ ✔ 6 │ ⏸ 0 │ Finished at 20:57:35 after 13s
also wondering how to best handle versioning, since my current ci setup uses current time for that | 19:58:31 |
Emma [it/its] | rm -rf *.nupkg
export DATE=`date -u '+%Y%m%d-%H%M%S'`
export REV=`git rev-parse --short HEAD`
dotnet pack --nologo --version-suffix preview.$DATE+$REV -o . ArcaneLibs
dotnet pack --nologo --version-suffix preview.$DATE+$REV -o . ArcaneLibs.Logging
dotnet pack --nologo --version-suffix preview.$DATE+$REV -o . ArcaneLibs.Timings
dotnet pack --nologo --version-suffix preview.$DATE+$REV -o . ArcaneLibs.Legacy
dotnet pack --nologo --version-suffix preview.$DATE+$REV -o . ArcaneLibs.StringNormalisation
dotnet pack --nologo --version-suffix preview.$DATE+$REV -o . ArcaneLibs.Blazor.Components
dotnet nuget push $(ls *.nupkg) -k ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
that's my current ci setup, that i'd like to get rid of | 19:59:17 |
| niklaskorz joined the room. | 20:09:36 |
Emma [it/its] | oh... i didnt realise but the nupkg files are empty... lol | 21:17:21 |