diff options
97 files changed, 1185 insertions, 856 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index e7750bfc47f5..71422e4ed5a6 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -391,6 +391,11 @@ github = "asppsa"; name = "Alastair Pharo"; }; + astro = { + email = "astro@spaceboyz.net"; + github = "astro"; + name = "Astro"; + }; astsmtl = { email = "astsmtl@yandex.ru"; github = "astsmtl"; diff --git a/nixos/doc/manual/release-notes/rl-1903.xml b/nixos/doc/manual/release-notes/rl-1903.xml index 89d9f48aedd3..65761c12c6a4 100644 --- a/nixos/doc/manual/release-notes/rl-1903.xml +++ b/nixos/doc/manual/release-notes/rl-1903.xml @@ -408,6 +408,16 @@ from nixpkgs due to the lack of maintainers. </para> </listitem> + <listitem> + <para> + The <option>powerManagement.cpuFreqGovernor</option> option has been + aliased to <option>powerManagement.cpufreq.governor</option>. On laptops, + <option>powerManagement.cpuFreqGovernor</option> is sometimes set in + <literal>/etc/nixos/hardware-configuration.nix</literal>, so you can + rename it to the new name, or run + <literal>nixos-generate-config</literal> again. + </para> + </listitem> </itemizedlist> </section> </section> diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index 52a129b39bcd..fa01dc7bbaf0 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -104,7 +104,7 @@ if (-e "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors") { foreach $e (@desired_governors) { if (index($governors, $e) != -1) { - last if (push @attrs, "powerManagement.cpuFreqGovernor = lib.mkDefault \"$e\";"); + last if (push @attrs, "powerManagement.cpufreq.governor = lib.mkDefault \"$e\";"); } } } diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index dc0a175d5bb8..0ed0f4ac209a 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -286,6 +286,9 @@ with lib; (mkRenamedOptionModule [ "hardware" "ckb" "enable" ] [ "hardware" "ckb-next" "enable" ]) (mkRenamedOptionModule [ "hardware" "ckb" "package" ] [ "hardware" "ckb-next" "package" ]) + # cpufeq + (mkAliasOptionModule [ "powerManagement" "cpuFreqGovernor" ] [ "powerManagement" "cpufreq" "governor" ]) + ] ++ (flip map [ "blackboxExporter" "collectdExporter" "fritzboxExporter" "jsonExporter" "minioExporter" "nginxExporter" "nodeExporter" "snmpExporter" "unifiExporter" "varnishExporter" ] diff --git a/nixos/modules/services/hardware/tlp.nix b/nixos/modules/services/hardware/tlp.nix index 68425822a884..bbc5b5b80a08 100644 --- a/nixos/modules/services/hardware/tlp.nix +++ b/nixos/modules/services/hardware/tlp.nix @@ -55,7 +55,9 @@ in config = mkIf cfg.enable { powerManagement.scsiLinkPolicy = null; - powerManagement.cpuFreqGovernor = null; + powerManagement.cpufreq.governor = null; + powerManagement.cpufreq.max = null; + powerManagement.cpufreq.min = null; systemd.sockets."systemd-rfkill".enable = false; diff --git a/nixos/modules/services/networking/shairport-sync.nix b/nixos/modules/services/networking/shairport-sync.nix index 90c0689dc7bf..68e005ab81da 100644 --- a/nixos/modules/services/networking/shairport-sync.nix +++ b/nixos/modules/services/networking/shairport-sync.nix @@ -27,7 +27,7 @@ in }; arguments = mkOption { - default = "-v pulse"; + default = "-v -o pa"; description = '' Arguments to pass to the daemon. Defaults to a local pulseaudio server. diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix index 5fab79f1b3d7..90d08ca31316 100644 --- a/nixos/modules/services/networking/ssh/sshd.nix +++ b/nixos/modules/services/networking/ssh/sshd.nix @@ -352,6 +352,10 @@ in path = [ cfgc.package pkgs.gawk ]; environment.LD_LIBRARY_PATH = nssModulesPath; + restartTriggers = optionals (!cfg.startWhenNeeded) [ + config.environment.etc."ssh/sshd_config".source + ]; + preStart = '' # Make sure we don't write to stdout, since in case of @@ -387,6 +391,7 @@ in Restart = "always"; Type = "simple"; }); + }; in diff --git a/nixos/modules/tasks/cpu-freq.nix b/nixos/modules/tasks/cpu-freq.nix index 5f8b5df52acf..684c43a1e903 100644 --- a/nixos/modules/tasks/cpu-freq.nix +++ b/nixos/modules/tasks/cpu-freq.nix @@ -4,22 +4,43 @@ with lib; let cpupower = config.boot.kernelPackages.cpupower; - cfg = config.powerManagement; + cfg = config.powerManagement.cpufreq; in { ###### interface - options = { + options.powerManagement.cpufreq = { - powerManagement.cpuFreqGovernor = mkOption { + governor = mkOption { type = types.nullOr types.str; default = null; example = "ondemand"; description = '' Configure the governor used to regulate the frequence of the available CPUs. By default, the kernel configures the - performance governor. + performance governor, although this may be overwriten in your + hardware-configuration.nix file. + + Often used values: "ondemand", "powersave", "performance" + ''; + }; + + max = mkOption { + type = types.nullOr types.ints.unsigned; + default = null; + example = 2200000; + description = '' + The maximum frequency the CPU will use. Defaults to the maximum possible. + ''; + }; + + min = mkOption { + type = types.nullOr types.ints.unsigned; + default = null; + example = 800000; + description = '' + The minimum frequency the CPU will use. ''; }; @@ -28,25 +49,37 @@ in ###### implementation - config = mkIf (!config.boot.isContainer && config.powerManagement.cpuFreqGovernor != null) { + config = + let + governorEnable = cfg.governor != null; + ma |