-
-
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
slow nix build in devcontainer #11249
Comments
I couldn't reproduce this. Maybe you can add |
Thanks for stepping in! I will post a |
Here it is: This is an excerpt of the output of
Below is the output of just
Note! The two logs are not from the exact same phase of the build, but both logs are from one of those periodically occuring slow parts of the build. What I find a little confusting is that the second log suggest we are executing the builder while things arent moving. The more verbose log though suggests, that we are still downloading stuff during that phase (which appearantly is not going smoothly). Htop suggests that the nix-daemon is using maximum resources in those phases. Additional Note: As far as I can tell, there are no network issues with the pod. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-08-12-nix-team-meeting-minutes-168/50561/1 |
Describe the bug
Building nix flakes in a devpod devcontainer takes significantly longer (hours) compared to bare metal (seconds).
Steps To Reproduce
0. I am on a Fedora machine (not NixOS) but I think this is irrelevant for the issue
.devcontainer.json
with a nix featuressh myproject.devod nix build .#mything
Additional Context
I am trying to find a way to apply my home-manager configuration to a devcontainer. I cant wait hours for this to finish as it totally defeats the purpose of having devcontainers that you can quickly spin up whenever you need them.
Even though I am only concerned about my hm-flake, I think the issue is more general, as all nix-building seems very slow.
my home-manager config can be found here.
What i tried so far
My first thought was, that nix is just building way more stuff than it should not using cache.nixos properly, but I was able to verify that this is not the case. To narrow this down even further I did a
nix build .#homeConfigurations.myuser.activationPackage
on my host followed bynix copy --no-check-sigs --to ssh-ng:devpodtesting.devpod ./result # in devpod: /nix/store/somehash-home-manager-generateion/activate
I really expected this to work smoothly but other than expected it is still taking about 15min just to install the home-manager-path.
I am fairly new to nix and I ran out of ideas, of how to noarrow down the issue further, so any pointers would very much be appreciated!
lentilus
The text was updated successfully, but these errors were encountered: