[Nix-dev] Hi nix developers!

Nicolas Pierron nicolas.b.pierron at gmail.com
Sat Apr 4 19:15:21 CEST 2009


On Fri, Apr 3, 2009 at 11:57, Nicolas Pierron
<nicolas.b.pierron at gmail.com> wrote:
> Hi Tony,
>
> On Fri, Apr 3, 2009 at 10:31, Tony White <tonywhite100 at googlemail.com> wrote:
>> How do I add mem=1024M to grub's menu.lst? (Named
>> /boot/nixos-grub-config in Nixos.)
>> Is it possible without editing nixos-grub-config and setting it as
>> default for all further kernel entries?
>
> The menu.lst file is not the one that your are pointing.  The menu.lst
> file is contained inside /boot/grub/.  To add the kernel parameter to
> each new NixOS entry you have to set the option boot.kernelParams
> inside your configuration.nix file.
>
> {
>  boot = {
>    kernelParams = [
>      "selinux=0"
>      "apm=on"
>      "acpi=on"
>      "vga=0x317"
>      "console=tty1"
>      "splash=verbose"
>      "mem=1024M" # The machine suffers from a memory allocation bug
>    ];
>  };
> }

This answer is bad because it force you to repeat low-level kernel
parameters which are on top of your option.  If you want to add extra
parameters to these primary parameters, you should prefer
"extrakernelParams" instead of "kernelParams".

{
  boot = {
    extraKernelParams = [
      "mem=1024M" # The machine suffers from a memory allocation bug
    ];
  };
}

(IMO) This way of writing is a bit annoying and we should probably
look at removing the "extra***" options by replacing the default
kernel parameters by extra options with default values.

-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron
- If you are doing something twice then you should try to do it once.



More information about the nix-dev mailing list