| 14 Aug 2025 |
GGG | that's because you're including the deps.json into your project, you should exclude it from the projects by editing the .csproj or by filtering them out of src | 20:25:35 |
oatmealraisin | *
let
Application = import ../Application { pkgs = pkgs; };
DataMatrixGenerator = import ../../utils/DataMatrixGenerator { pkgs = pkgs; };
Infrastrcture = import ../Infrastructure { pkgs = pkgs; };
WebUI = import ../WebUI { pkgs = pkgs; };
in
pkgs.buildDotnetModule {
pname = "API.csproj";
version = "0.1";
src = ../..;
projectFile = "src/API/API.csproj";
buildInputs = [
Application
DataMatrixGenerator
Infrastrcture
WebUI
];
dotnetPackFlags = [ "-p:RuntimeIdentifier=linux-x64" ];
nugetDeps = ./deps.json;
packNupkg = false;
}
| 20:25:36 |
GGG | I don't recommend embedding the nix files into your source like that, I'd put them into a separate directory where they don't mix with the code | 20:26:15 |
Corngood | Hmm, maybe we can use dotnet sln list to check for a solution | 20:34:22 |
oatmealraisin | It's kinda hard to find info on conventions around projects instead of nixos, where do you normally put your *.nix files? | 20:36:04 |
Whovian9369 | Speaking from personal experience when looking around, I commonly see flake.nix and flake.lock in the root of the repository, while extra files (package.nix/default.nix, deps.json, etc) being relegated to /nix/ | 20:39:25 |
Whovian9369 | * Speaking from personal experience when looking around, I commonly see flake.nix and flake.lock in the root of the repository, while extra files (package.nix/default.nix, deps.json, etc) being relegated to a repo's /nix/ | 20:39:47 |
oatmealraisin | Alright, I'll start moving everything over there and try this again | 20:47:58 |
oatmealraisin | These builds take a pretty ridiculous amount of time, rough stuff | 20:48:15 |
Corngood | Why is it picking up deps.json? Is that a special filename in dotnet? | 20:56:52 |
Whovian9369 | So because my computer needs replaced: I had to do an unplanned power down, my WSL filesystem seems to have corrupted, and it looks like e2fsck basically destroyed the filesystem as WSL now refuses to boot it. 🙃
I may not be able to do the build test in the near future. 😅
| 21:15:27 |
Corngood | Oh brutal :( | 21:41:23 |
Whovian9369 | I'll see what I can easily recover from it and see how quickly I can spin back up | 21:41:43 |
Corngood | src = ../..; seems strange to me. Why don't you set it to the root of each project? | 21:44:20 |
oatmealraisin | Because then I get issues during build saying the referenced projects don't exist | 22:12:39 |
oatmealraisin | Idk if I can replicate at this point, a lot has changed | 22:12:52 |
Corngood | Well in that case the projectFile would just be `API.csproj`, or you could probably just omit it. | 22:13:37 |
oatmealraisin | Yes, but projectReferences would be missing, I don't have error logs but it would complain about the csproj files for project references being missing | 22:15:49 |
oatmealraisin | It's very possible I was doing something else wrong, but now all the nix stuff is in a different directory | 22:20:04 |
Corngood | Yeah, you can't do it with ProjectReference. You need to use PackageReference. There are basically two ways to do what you're trying to do, and you're sort of in-between them:
-
one nix derivation with an assortment of projects linked together with ProjectReference, one deps.json
-
one nix derivation per nuget package with packNupkg = true, using PackageReference
| 22:24:38 |
GGG | by default it just copies all json files to publish output | 22:47:48 |
GGG | (I can't remember if it's ASP.NET Core specific or not) | 22:47:59 |
| 15 Aug 2025 |
Emma [it/its] | huh? i've never had aspnetcore do that | 12:55:48 |
Emma [it/its] | it sure doesnt copy appsettings.Local.json | 12:56:14 |
Emma [it/its] | * it sure doesnt copy appsettings.Local.json by default | 12:56:18 |
| 16 Aug 2025 |
GGG | yes, because the csproj has an exclusion for that iirc | 00:00:48 |
Emma [it/its] | It doesnt though? | 07:24:09 |
Emma [it/its] | Local was just an example, pick anything and it wont be copied | 07:24:57 |
| 18 Aug 2025 |
oatmealraisin | It took me all weekend to read this correctly, haha. So the entire project has a solution file (and an slnf file for excluding tests). I was under the assumption I needed to build each one individually to get everything to work, that's not true? | 19:17:24 |
GGG | no | 19:17:46 |