nixpkgs-suyu/nixos/modules
Maximilian Bosch 8ed3a90cdf
nixos/powerManagement: set cpuFreqGovernor with mkOptionDefault
`nixos-generate-config` detects the `cpuFreqGovernor` suited best for my
machine, e.g. `powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";`.

However the `powerManagement` module sets a sensitive default for
`cpuFreqGovernor` using `mkDefault` to avoid breackage with older
setups. Since 140ac2f1 the `hardware-configuration.nix` sets the
gorvernor with `mkDefault` as well which causes evaluation errors if the
powermanagement module is enabled:

```
error: The unique option `powerManagement.cpuFreqGovernor' is defined multiple times, in `/home/ma27/Projects/nixos-config/hardware-configuration.nix' and `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/config/power-management.nix'.
```

Using `mkOptionDefault` rather than `mkDefault` in the powermanagement
module fixes this issue as it decreases the priority of the module and
prefers the value set in `hardware-configuration.nix`.

I have confirmed the change using the following VM declaration:

```
{
  cpuFreq = { lib, ... }: {
    powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
    powerManagement.enable = true;
  };
}
```
2018-01-28 09:38:45 +01:00
..
config nixos/powerManagement: set cpuFreqGovernor with mkOptionDefault 2018-01-28 09:38:45 +01:00
hardware intel-ocl: r4.0-59481 -> 5.0-63503 2017-11-01 17:59:49 +00:00
i18n/input-method Remove top-level kde5 attribute 2017-02-27 11:49:10 -06:00
installer nixos/sd-image-*.nix: Bring back high consoleLogLevel 2018-01-24 18:23:32 +02:00
misc nixos/mighttpd2: init 2018-01-16 21:04:09 +00:00
profiles nixos/profiles/all-hardware: remove unavailable modules 2017-12-29 11:37:21 +01:00
programs zsh doc: precise environment.shellAliases 2018-01-22 10:40:23 +09:00
security sudo: define extra rules in Nix language (#33905) 2018-01-17 14:56:08 +00:00
services samba4/sambaMaster: Modify services to align with Samba project usage 2018-01-26 22:37:17 +01:00
system nixos/initrd: Don't include some x86-specific modules unconditionally 2018-01-22 12:53:33 +02:00
tasks nixos: zfs: correct the networking.hostId error message 2017-12-20 17:56:03 -05:00
testing tests: logToJournal has been renamed 2017-12-06 17:45:40 +08:00
virtualisation Merge pull request #34052 from volth/patch-86 2018-01-22 14:39:29 +00:00
module-list.nix nixos/stunnel: add module (#33151) 2018-01-21 11:23:07 +00:00
rename.nix Revert "nixos/dnscrypt-proxy: remove" 2018-01-08 15:09:33 +01:00