[Nix-dev] Re: [Nix-commits] SVN commit: nix - 17518 - raskin - configurations/trunk/misc/raskin

Nicolas Pierron nicolas.b.pierron at gmail.com
Wed Sep 30 11:46:05 CEST 2009


Hi Michael,

On Wed, Sep 30, 2009 at 05:44, Michael Raskin <7c6f434c at mail.ru> wrote:
> Modified: configurations/trunk/misc/raskin/raskin.nix
> ===================================================================
> --- configurations/trunk/misc/raskin/raskin.nix 2009-09-29 22:03:39 UTC (rev 17517)
> +++ configurations/trunk/misc/raskin/raskin.nix 2009-09-30 03:44:47 UTC (rev 17518)
>       (base // {
>          boot = base.boot // {
> -           configurationName = "2.6.31-zen0";
> -           kernelPackages = pkgs.kernelPackages_2_6_31_zen0;
> -           extraModulePackages = (bootEntries pkgs.kernel_2_6_31_zen0).extraModulePackages;
> +               loader = base.boot.loader // {
> +                       grub = base.boot.loader.grub // {
> +           configurationName = "2.6.31-zen2";
> +                       };
> +               };
> +           kernelPackages = pkgs.kernelPackages_2_6_31_zen2;
> +           extraModulePackages = (bootEntries pkgs.kernel_2_6_31_zen2).extraModulePackages;
>          };
>        })

Could you try:

(recursiveUpdate base {
  boot.loader.grub.configurationName = "2.6.31-zen2";
  boot.kernelPackages = pkgs.kernelPackages_2_6_31_zen2;
  boot.extraModulePackages = (bootEntries
pkgs.kernel_2_6_31_zen2).extraModulePackages;
})

instead of the current overload.  I am not extremely confident on the
result because recursiveUpdate stop on non-attribute set, so I should
probably add a limitation on derivation to avoid merging result from
your previous kernel packages with the current one.

Otherwise the following expression may work:

let
  chgKernel = recursiveUpdate base {
    boot.kernelPackages = "This attribute should be updated.";
  });
in ...

(recursiveUpdate chgKernel {
    boot.loader.grub.configurationName = "2.6.31-zen2";
    boot.kernelPackages = pkgs.kernelPackages_2_6_31_zen2;
    boot.extraModulePackages = (bootEntries
pkgs.kernel_2_6_31_zen2).extraModulePackages;
})


By the way, instead of using the "base" variable, you can use the
"config" argument in which you remove the content of the children
attribute:

{config, ...}:

let
  base = recursiveUpdate base {
    nesting.children = [];
  });
in


Cheers,

-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron
Andrew S. Tanenbaum - Never underestimate the bandwith of a wagon full of tapes.



More information about the nix-dev mailing list