Skip to content

Slow rebuild (single threaded) #619

Answered by taki-sahli
taki-sahli asked this question in Q&A

You must be logged in to vote

Hello, actualy it was all derivations, the build in the screenshot took 6 hours to finish.
I found the cause the problem, it was the sudo command, when I run sudo nixos-rebuild switch, it was super slow, but when I run nixos-rebuild build, it was super fast, so now I'm using this script to switch:

nixos-rebuild build
sudo ./result/activate
rm ./result

For remote, I use this command:

NIX_SSHOPTS="-i /home/user/.ssh/private.key" \
  nixos-rebuild \
    switch \
    --target-host "user@${hostname}" \
    --use-remote-sudo

Reference: https://discourse.nixos.org/t/can-i-run-nixos-rebuild-switch-flake-rootless/14610/3

Replies: 1 comment 1 reply

You must be logged in to vote
1 reply
@taki-sahli

Answer selected by taki-sahli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants