nixpkgs/nixos
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
..
doc/manual Merge pull request #34060 from WilliButz/fix-postfix-module 2018-01-26 13:33:49 +00:00
lib nixos/make-disk-image.nix: Support EFI images 2018-01-22 11:18:23 +02:00
maintainers nixos/make-disk-image.nix: Support EFI images 2018-01-22 11:18:23 +02:00
modules nixos/powerManagement: set cpuFreqGovernor with mkOptionDefault 2018-01-28 09:38:45 +01:00
tests nixos/tests: Fix statsd test evaluation 2018-01-26 23:29:53 +02:00
COPYING
default.nix Remove nixFallback 2017-03-06 15:54:50 +01:00
README
release-combined.nix nixos/release.nix: Introduce callSubTestsOnTheseSystems 2018-01-23 12:24:33 +02:00
release-small.nix php: pcre test blocks -small channels as well 2017-11-12 11:03:54 +01:00
release.nix nixos/release.nix: Use callSubTestsOnTheseSystems for ec2 tests 2018-01-23 12:43:24 +02:00

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
http://nixos.org/nixos and in the manual in doc/manual.