[Nix-dev] [PATCH] Put old generations in grub submenu (NixOS)

Nicolas Pierron nicolas.b.pierron at gmail.com
Sun Mar 11 10:36:33 CET 2012


Hi Andreas,

Sorry for not answering before, nix mailing list is sometimes noisy
and we skip some emails.

2012/2/2 Andreas Källberg <anka.213 at gmail.com>:
> I have made a patch which adds an option
> (config.boot.loader.grub.oldVersionsInSubmenu)
> for hiding the old versions of the system in a submenu to reduce cluttering.

Awesome !

> This is my first patch, so bare with me if I made any stupid mistakes ;-)

Great Job.  I am sure we can come up with a nicer name for this option. ;-)

> Now that I think of it, I should probably make sure the option is disabled if
> grub.version = 1, not sure how to do that though.

Have a look at the "assertions" option.
Then you may want to add it to the "implementation" section of grub.nix.

spoiler:

assertions = mkIf config.boot.loader.grub.oldVersionsInSubmenu [ {
  assertion = config.boot.loader.grub.version == 2;
  msg = "...";
} ];

PS: you should to add

  cfg = config.boot.loader.grub;

in the preamble to reduce the writing pain ;-)

-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/


More information about the nix-dev mailing list