You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A number of the generated formats that are supported by nixos-generators don't use or support bootloaders, for example Docker, kexec, or lxc. I would like to propose that for those in particular where "installing grub" absolutely doesn't make any sense we set options like boot.loader.grub.enable = lib.mkForce false and boot.loader.systemd-boot.enable = lib.mkForce false.
This may fall squarely into idiot-proofing, but think it would improve the overall user experience because reusing an existing configuration will be easier.
I would be happy to make a PR, but I wanted to make a proposal via an Issue first before I put any effort into it, in case anyone else disagrees or has a different idea as to how this could or should be achieved.
Instead of a full PR, let me provide inline an example of what I have in mind:
My thought process is that if installing a bootloader is impossible or otherwise makes no sense in a format provided by nixos-generators then adding such a setting mkForce'd to off will make reusing an existing NixOS configuration easier — for example if I wanted to package up into Docker something I was testing as a VM, I wouldn't have to touch existing bootloader settings.
Maybe there should be some higher-up NixOS option we can toggle like boot.loader.enable that itself would override options like boot.loader.systemd-boot.enable and boot.loader.grub.enable? I'm not sure…
I understand that in general the Nix Community is pretty strongly opinionated against Nix being pretty opinionated, but given that nixos-generators is mostly a sugary wrapping around existing modules in <nixpkgs>, maybe adding a little more idiot-proofing sugar might help things? 😄 Just to be clear, I am NOT trying to impose using any particular bootloader or not on anyone in any situation, at all. I just think that bootloaders should be forcibly disabled for formats in which a bootloader inherently absolutely does not make sense.
The text was updated successfully, but these errors were encountered:
sounds like a good idea. Although I'm (very) slowly trying to move most of the code here to nixpkgs itself. But until that is finished we can add those overrides here
A number of the generated formats that are supported by
nixos-generators
don't use or support bootloaders, for example Docker, kexec, or lxc. I would like to propose that for those in particular where "installing grub" absolutely doesn't make any sense we set options likeboot.loader.grub.enable = lib.mkForce false
andboot.loader.systemd-boot.enable = lib.mkForce false
.This may fall squarely into idiot-proofing, but think it would improve the overall user experience because reusing an existing configuration will be easier.
I would be happy to make a PR, but I wanted to make a proposal via an Issue first before I put any effort into it, in case anyone else disagrees or has a different idea as to how this could or should be achieved.
Instead of a full PR, let me provide inline an example of what I have in mind:
My thought process is that if installing a bootloader is impossible or otherwise makes no sense in a format provided by
nixos-generators
then adding such a setting mkForce'd to off will make reusing an existing NixOS configuration easier — for example if I wanted to package up into Docker something I was testing as a VM, I wouldn't have to touch existing bootloader settings.Some of the formats such as kexec already disable grub (https://github.com/nix-community/nixos-generators/blob/0aa24e93f75370454f0e03747b6836ac2a2c9fca/formats/kexec.nix#L86C1-L87C1) but I think that not using
lib.mkDefault
orlib.mkForce
in these situations might cause more confusion and frustration than not, since the resulting conflict error might not even make it clear what in your configuration is causing a conflict.Maybe there should be some higher-up NixOS option we can toggle like
boot.loader.enable
that itself would override options likeboot.loader.systemd-boot.enable
andboot.loader.grub.enable
? I'm not sure…I understand that in general the Nix Community is pretty strongly opinionated against Nix being pretty opinionated, but given that
nixos-generators
is mostly a sugary wrapping around existing modules in<nixpkgs>
, maybe adding a little more idiot-proofing sugar might help things? 😄 Just to be clear, I am NOT trying to impose using any particular bootloader or not on anyone in any situation, at all. I just think that bootloaders should be forcibly disabled for formats in which a bootloader inherently absolutely does not make sense.The text was updated successfully, but these errors were encountered: