[Nix-dev] Gratuitous generations

Eelco Dolstra eelco.dolstra at logicblox.com
Mon Mar 30 15:07:41 CEST 2015


Hi,

On 30/03/15 14:45, Christian Theune wrote:

> last year I experimented with self-managing NixOS installations. One thing
> that I stumbled upon was that regularly triggering nixos-rebuild would create
> new generations even though the config hadn’t changed.
> 
> Is there a way to suppress that or a reason why this can’t be suppressed in
> general?

The reason is to ensure that "nixos-rebuild switch; nixos-rebuild rollback"
always rolls back to the configuration just before the switch, not to some
earlier configuration. If "nixos-rebuild switch" is a logical no-op, then the
rollback should do nothing, too.

Note that generations are cheap (they're just symlinks), but we should probably
filter redundant generations from the GRUB boot menu.

> What I want is to create a simple cronjob that generates Nix OS configuration
> from an upstream “source of truth”, like users, and not think about
> convergence but just trigger nixos-rebuild after updating the config. If
> nothing changed then no new generation should appear IMHO.

We could add an option to suppress creating a new generation if nothing has changed.

-- 
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/


More information about the nix-dev mailing list