Hi,

I'd like to extend power-management.nix with an aggressive setting:

      aggressive = mkOption {
        default = false;
        description =
          ''
            Whether to enable aggressive power management features. An
            area for experimentation. Please send feedback about this
            to the list.
          '';
      };

and:

config = mkIf cfg.enable {
  ...
  powerManagement.cpuFreqGovernor = "ondemand";
} // cfg.aggressive ? {
  ...
  powerManagement.scsiLinkPolicy = "min_power";
} : {};

Now for one the syntax is incorrect and for another
powerManagement.cpuFreqGovernor would not be set, as powerManagement
will be overriden with the value from the second attribute set.

Is there a way to recursively merge attribute sets, so that
cpuFreqGovernor and scsiLinkPolicy would be set in powerManagement?

How can I achieve the conditional merge?

I tried:

config = mkIf cfg.enable ({
  ...
} // (if cfg.aggressive then {
  ...
} else { }));

--> infinite recursion

regards
florian
-- 
Florian Friesdorf <[email protected]>
  GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
Jabber/XMPP: [email protected]
IRC: chaoflow on freenode,ircnet,blafasel,OFTC

Attachment: pgpjvZ6oyIeVy.pgp
Description: PGP signature

_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to