-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Submodules of flakes are not working #6633
Comments
Working for me if you include the $ nix build .?submodules=1
$ cat result
foobar |
Even with Either you just use the submodule path:
However, this updates the lockfile on each invocation and using the flake in the repl is cumbersome. Or you use it as a git file input. That solves the repeated locking but just ignores it the referenced submodule is dirty:
|
Huh, I'm not referencing the submodule (directly) as an input at all and it's been working well for my use case (maintaining my nix-darwin flake-based config containing a |
Ahhhh! This just got me too. |
Phenomenal, thank you! |
Does anyone else here experiences that for a NOTE: I am using |
Answering my own question: If the tree is dirty, and at least 1 git submodule is not checked out, the tree has to be clean for Nix to pick up the missing submodule using the |
Worth noting for people reading to the end in future: it's |
Is it possible to also apply the |
I found the answer to my question. One should use: |
When I do this command
|
Try this: nixos-rebuild dry-build --impure --flake .\?submodules=1#nix-deck The |
Thanks! That makes a lot more sense. |
For some reason on MacOS I've not been able to get
|
Are you in the directory when you call |
In 2.20.1 version, PS: to reproduce the miminal example from the issue, you should run |
Having the same problem, |
It looks like there's a bug in the flakeref parser that causes That's likely my fault, I'll look into it |
Simple unit tests, but already catch half of the issue behind #6633 (comment)
I've opened #10125 to fix the parsing issue (was hairier than expected, because there were actually two bugs stacked on top of each other 😒 ) |
|
See NixOS/nix#6633 (comment) (we've got a newer nix).
Describe the bug
Having git submodules in a git repository I cannot access the submodules in my flake.nix. This is especially annoying when I want to provide a flake.nix for software that is split across multiple git repositories that are all included as submodules in one main repo.
Steps To Reproduce
And
top/flake.nix
isThen run
nix build
.Expected behavior
I expect
result
to contain the stringfoobar
.Actual behaviour
nix-env --version
outputnix-env (Nix) 2.8.1
I also tried 2.8.0 and 2.9.1. The submodule is just missing and I see no way to access it.
Additional context
Also manually adding the submodule as an input like so
and then changing the
src = self
tosrc = sub
in theoutputs
, just results in a weird error message instead of the submodule just working as it should:Especially the
error (ignored): error: end of string reached
line is worrying me and probably show that this is actually a bug and should work. Of course this could also just be my own stupidity and I'm doing something completely wrong.The text was updated successfully, but these errors were encountered: