nixpkgs-suyu/nixos/modules/config
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
..
fonts fonts: fix fontconfig.localConf when used with penultimate 2017-11-10 16:57:45 -05:00
krb5 krb5: add deprecation date for old configuration 2017-10-03 11:01:05 +01:00
debug-info.nix Set $NIX_DEBUG_INFO_DIRS when environment.enableDebugInfo is enabled 2017-10-10 12:04:57 +02:00
gnu.nix
i18n.nix nixos: update glibc locales link 2017-09-03 18:00:35 +00:00
ldap.nix
networking.nix nixos/networking: support static resolv.conf 2017-12-04 13:58:54 +00:00
no-x-libs.nix pinentry: override pinentry_ncurses instead of the other way around 2017-12-16 04:39:29 +01:00
nsswitch.nix nsswitch: use [NOTFOUND=return] for mdns 2017-10-16 15:11:58 +02:00
power-management.nix nixos/powerManagement: set cpuFreqGovernor with mkOptionDefault 2018-01-28 09:38:45 +01:00
pulseaudio.nix nixos/pulseaudio: document audio group for system wide access 2017-11-30 06:37:01 +00:00
shells-environment.nix environment.variables: give an example 2018-01-22 10:40:23 +09:00
swap.nix change swap.randomEncryption config option to "coercedTo" for backwards compatibility 2017-07-26 20:57:10 +03:00
sysctl.nix
system-environment.nix
system-path.nix nix-info: include in nixos' default system-path, nixpkgs's channel 2017-10-14 22:01:30 -04:00
terminfo.nix
timezone.nix nixos/config/timezone: Disallow spaces 2017-10-09 20:52:25 +02:00
unix-odbc-drivers.nix
update-users-groups.pl
users-groups.nix users-groups module: use buildEnv in per-user profiles 2017-11-05 17:56:31 +01:00
vpnc.nix
zram.nix