Sometimes when doing nixos-rebuild switch --flake I need to install 20GB+

Hello

I changed something very minimal to my config (adjust a zsh alias for example) I need to install 20Gb+ (a lot) of data.

Why does this happen? It feels like I need to reinstall every package without any reason, I just want to update my zsh config :confused:

Flake file: dotFiles/flake.nix at a1e7a18934fa13f5e723c1b09e95ca9bae0530a5 Ā· sevaho/dotFiles Ā· GitHub

Greetings

Youā€™re mixing stable and unstable, I would expect many gigabytes of downloads.
Also, nix flake update will update the nixpkgs revision and thereby lead to more downloading, so if you want to space out your updates more, you can do that.

1 Like

Hello @waffle8946 I am running:

sudo nixos-rebuild switch --flake ".#desktop-nixos-workstation"

I only use nix flake update to update packages (which I did not use now).

I actually only want to use unstable for some packages for example: neovim, yazi, lazygit and a couple more. This was the solution I found. If you have another more simple solution please tell me :smiley: ! I am quite new to nixos, but unstable gave me a lot of headaches with qutebrowser and python in general so that is why this setup.

I setup my config take from unstable and install ā€˜someā€™ stable pacakges, but I donā€™t need all the unstable pacakges, I only need ā€˜someā€™ unstable pacakges.
If I switch my config the other way around so that almost all pacakges come from stable and only ā€˜someā€™ from unstable my issue is solved? Got it from here : Use unstable version for some packages

Very likely you updated your lockfile, and a staging merge happened in the meantime, causing a ā€œmass rebuildā€ which due to substitution is visuble to you as a mass download.

If you do not want to update, but just change zsh config, donā€™t run nix flake update.

2 Likes