Closed Smaug123 closed 1 month ago
This is sort-of fixed by #336824, but you have to explicitly pass in the output path, e.g. ./result nix/deps.nix
.
defaultDepsFile =
# Wire in the depsFile such that running the script with no args
# runs it agains the correct deps file by default.
# Note that toString is necessary here as it results in the path at
# eval time (i.e. to the file in your local Nixpkgs checkout) rather
# than the Nix store path of the path after it's been imported.
if lib.isPath nugetDeps && !lib.isStorePath nugetDeps then
toString nugetDeps
else
''$(mktemp -t "${finalAttrs.pname or finalPackage.name}-deps-XXXXXX.nix")'';
In a flake, everything is evaluated from the store, so nugetDeps
is e.g. /nix/store/5hxbzwsgzjp0z6z7ff2g9b4r16pffr3d-source/nix/deps.nix
. The code above is supposed to take care of that, but apparently lib.isStorePath
only returns true for paths whose immediate parent is the store directory (so like /nix/store/a
, but not /nix/store/a/b
).
I'd love this to find the output path properly with flakes, but I'm not sure that's possible if you're evaluating something immutable. I went looking for discussion of this in relation to updateScript
, since it would have the same problem, and the only thing I found was: https://discourse.nixos.org/t/how-can-i-run-the-updatescript-of-personal-packages/25274/2. They ended up using flake-compat
, which might be the only way...
That's a perfectly fine restriction in my book! I'll leave this open and retry it when #336824 goes in.
Lovely, that fix worked for me!
Describe the bug
Some time in the last week, the passthru
fetch-deps
for NuGet has started doing this:In my non-interactive pipelines, this was immediately fatal (https://github.com/Smaug123/WoofWare.Myriad/actions/runs/10866966813/job/30155191667). Nixpkgs revision 9bb1e7571aadf31ddb4af77fc64b2d59580f9a39 was fine; revision 01f064c99c792715054dc7a70e4c1626dbbec0c3 had the problem.
Steps To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/Smaug123/WoofWare.DotnetRuntimeLocator
andgit checkout a72db2a820fe92080018d623893a48a54f96038b
nix build .#default.passthru.fetch-deps && ./result
Expected behavior
The usual upgrade, resulting in a
deps.nix
file in in/tmp
.Notify maintainers
@corngood
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a :+1: reaction to issues you find important.