4.0 has been out for a year without another upstream release, so
presumably 4.x's quite stable enough (and already in Arch & Debian
Buster for instance).
`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;
};
}
```
This reverts commit bc474e2dd8.
Source hash is incorrect:
https://hydra.nixos.org/build/68234054
And even fixing it doesn't make it compile:
Checking for system tdb (>=1.3.15) : not found
ERROR: System library tdb of version 1.3.15 not found, and bundling disabled
builder for ‘/nix/store/bxnawxa402vrv4qmcmj2hmp98a0bz7li-ldb-1.3.1.drv’ failed with exit code 1
error: build of ‘/nix/store/bxnawxa402vrv4qmcmj2hmp98a0bz7li-ldb-1.3.1.drv’ failed