summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authoréclairevoyant <848000+eclairevoyant@users.noreply.github.com>2024-06-26 01:22:50 +0000
committerGitHub <noreply@github.com>2024-06-26 01:22:50 +0000
commit48893bc89bc58184d026f2347308f1d8a1db8d24 (patch)
tree3eec41bbe48bdac2f712c0d050cbf89bba8a0ca6 /doc
parent6a0926dd33a55486d789da1e412ddb7a608fe948 (diff)
parent5c3f56c32a4c0897b88db692866ec2575332adc5 (diff)
Merge pull request #322184 from YoshiRulz/dotnet-docs
doc: Update note under `buildDotnetModule` to reflect actual behaviour
Diffstat (limited to 'doc')
-rw-r--r--doc/languages-frameworks/dotnet.section.md15
1 files changed, 9 insertions, 6 deletions
diff --git a/doc/languages-frameworks/dotnet.section.md b/doc/languages-frameworks/dotnet.section.md
index 36c20a9e9c50..caf213845e6c 100644
--- a/doc/languages-frameworks/dotnet.section.md
+++ b/doc/languages-frameworks/dotnet.section.md
@@ -141,9 +141,7 @@ in buildDotnetModule rec {
src = ./.;
projectFile = "src/project.sln";
- # File generated with `nix-build -A package.passthru.fetch-deps`.
- # To run fetch-deps when this file does not yet exist, set nugetDeps to null
- nugetDeps = ./deps.nix;
+ nugetDeps = ./deps.nix; # see "Generating and updating NuGet dependencies" section for details
projectReferences = [ referencedProject ]; # `referencedProject` must contain `nupkg` in the folder structure.
@@ -219,6 +217,12 @@ buildDotnetGlobalTool {
```
## Generating and updating NuGet dependencies {#generating-and-updating-nuget-dependencies}
+When writing a new expression, you can use the generated `fetch-deps` script to initialise the lockfile.
+After creating a blank `deps.nix` and pointing `nugetDeps` to it,
+build the script with `nix-build -A package.fetch-deps` and then run the result.
+(When the root attr is your package, it's simply `nix-build -A fetch-deps`.)
+
+There is also a manual method:
First, restore the packages to the `out` directory, ensure you have cloned
the upstream repository and you are inside it.
@@ -254,6 +258,5 @@ Finally, you move the `deps.nix` file to the appropriate location to be used by
If you ever need to update the dependencies of a package, you instead do
* `nix-build -A package.fetch-deps` to generate the update script for `package`
-* Run `./result deps.nix` to regenerate the lockfile to `deps.nix`, keep in mind if a location isn't provided, it will write to a temporary path instead
-* Finally, move the file where needed and look at its contents to confirm it has updated the dependencies.
-
+* Run `./result` to regenerate the lockfile to the path passed for `nugetDeps` (keep in mind if it can't be resolved to a local path, the script will write to `$1` or a temporary path instead)
+* Finally, ensure the correct file was written and the derivation can be built.