diff options
Diffstat (limited to 'nixos/modules/services')
15 files changed, 55 insertions, 26 deletions
diff --git a/nixos/modules/services/hardware/thinkfan.nix b/nixos/modules/services/hardware/thinkfan.nix index 5a898631e0903..d17121ca1c5bf 100644 --- a/nixos/modules/services/hardware/thinkfan.nix +++ b/nixos/modules/services/hardware/thinkfan.nix @@ -28,11 +28,14 @@ let # temperatures are read from the file. # # For example: - # sensor /proc/acpi/ibm/thermal (0, 0, 10) + # tp_thermal /proc/acpi/ibm/thermal (0, 0, 10) # will add a fixed value of 10 °C the 3rd value read from that file. Check out # http://www.thinkwiki.org/wiki/Thermal_Sensors to find out how much you may # want to add to certain temperatures. - + + ${cfg.fan} + ${cfg.sensors} + # Syntax: # (LEVEL, LOW, HIGH) # LEVEL is the fan level to use (0-7 with thinkpad_acpi) @@ -41,8 +44,6 @@ let # All numbers are integers. # - sensor ${cfg.sensor} (0, 10, 15, 2, 10, 5, 0, 3, 0, 3) - ${cfg.levels} ''; @@ -53,20 +54,52 @@ in { services.thinkfan = { enable = mkOption { + type = types.bool; default = false; description = '' Whether to enable thinkfan, fan controller for IBM/Lenovo ThinkPads. ''; }; - sensor = mkOption { - default = "/proc/acpi/ibm/thermal"; + sensors = mkOption { + type = types.lines; + default = '' + tp_thermal /proc/acpi/ibm/thermal (0,0,10) + ''; + description ='' + thinkfan can read temperatures from three possible sources: + + /proc/acpi/ibm/thermal + Which is provided by the thinkpad_acpi kernel + module (keyword tp_thermal) + + /sys/class/hwmon/*/temp*_input + Which may be provided by any hwmon drivers (keyword + hwmon) + + S.M.A.R.T. (since 0.9 and requires the USE_ATASMART compilation flag) + Which reads the temperature directly from the hard + disk using libatasmart (keyword atasmart) + + Multiple sensors may be added, in which case they will be + numbered in their order of appearance. + ''; + }; + + fan = mkOption { + type = types.str; + default = "tp_fan /proc/acpi/ibm/fan"; description ='' - Sensor used by thinkfan + Specifies the fan we want to use. + On anything other than a Thinkpad you'll probably + use some PWM control file in /sys/class/hwmon. + A sysfs fan would be specified like this: + pwm_fan /sys/class/hwmon/hwmon2/device/pwm1 ''; }; levels = mkOption { + type = types.lines; default = '' (0, 0, 55) (1, 48, 60) @@ -76,8 +109,12 @@ in { (7, 60, 85) (127, 80, 32767) ''; - description ='' - Sensor used by thinkfan + description = '' + (LEVEL, LOW, HIGH) + LEVEL is the fan level to use (0-7 with thinkpad_acpi). + LOW is the temperature at which to step down to the previous level. + HIGH is the temperature at which to step up to the next level. + All numbers are integers. ''; }; diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index 7bfc3bb648727..0266286aaacf9 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -4,8 +4,6 @@ with lib; let - inherit (pkgs) stdenv writeText procps; - udev = config.systemd.package; cfg = config.services.udev; diff --git a/nixos/modules/services/misc/leaps.nix b/nixos/modules/services/misc/leaps.nix index b92cf27f58dc5..d4e88ecbebdba 100644 --- a/nixos/modules/services/misc/leaps.nix +++ b/nixos/modules/services/misc/leaps.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... } @ args: +{ config, pkgs, lib, ... }: with lib; diff --git a/nixos/modules/services/monitoring/uptime.nix b/nixos/modules/services/monitoring/uptime.nix index 29616a085c8f3..b4d3a2640109a 100644 --- a/nixos/modules/services/monitoring/uptime.nix +++ b/nixos/modules/services/monitoring/uptime.nix @@ -1,6 +1,6 @@ { config, pkgs, lib, ... }: let - inherit (lib) mkOption mkEnableOption mkIf mkMerge types optionalAttrs optional; + inherit (lib) mkOption mkEnableOption mkIf mkMerge types optional; cfg = config.services.uptime; diff --git a/nixos/modules/services/network-filesystems/openafs/lib.nix b/nixos/modules/services/network-filesystems/openafs/lib.nix index 255740ac65ef4..cc68eea91f2d8 100644 --- a/nixos/modules/services/network-filesystems/openafs/lib.nix +++ b/nixos/modules/services/network-filesystems/openafs/lib.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, ...}: let - inherit (lib) concatStringsSep getBin mkOption types; + inherit (lib) concatStringsSep mkOption types; in rec { diff --git a/nixos/modules/services/network-filesystems/openafs/server.nix b/nixos/modules/services/network-filesystems/openafs/server.nix index aa8640fd240e3..4c80ed0839f7c 100644 --- a/nixos/modules/services/network-filesystems/openafs/server.nix +++ b/nixos/modules/services/network-filesystems/openafs/server.nix @@ -4,7 +4,7 @@ with import ./lib.nix { inherit config lib pkgs; }; let - inherit (lib) concatStringsSep intersperse mapAttrsToList mkForce mkIf mkMerge mkOption optionalString types; + inherit (lib) concatStringsSep mkIf mkOption optionalString types; bosConfig = pkgs.writeText "BosConfig" ('' restrictmode 1 diff --git a/nixos/modules/services/networking/chrony.nix b/nixos/modules/services/networking/chrony.nix index 6a89002b42deb..cef30661cc337 100644 --- a/nixos/modules/services/networking/chrony.nix +++ b/nixos/modules/services/networking/chrony.nix @@ -4,8 +4,6 @@ with lib; let - inherit (pkgs) chrony; - stateDir = "/var/lib/chrony"; keyFile = "/etc/chrony.keys"; diff --git a/nixos/modules/services/system/kerberos.nix b/nixos/modules/services/system/kerberos.nix index d85dee089827b..d151385d2f9be 100644 --- a/nixos/modules/services/system/kerberos.nix +++ b/nixos/modules/services/system/kerberos.nix @@ -2,7 +2,7 @@ let - inherit (lib) mkOption mkIf singleton; + inherit (lib) mkOption mkIf; inherit (pkgs) heimdalFull; diff --git a/nixos/modules/services/system/nscd.nix b/nixos/modules/services/system/nscd.nix index 11a30ea81ba97..fd1570d119807 100644 --- a/nixos/modules/services/system/nscd.nix +++ b/nixos/modules/services/system/nscd.nix @@ -7,8 +7,6 @@ let nssModulesPath = config.system.nssModules.path; cfg = config.services.nscd; - inherit (lib) singleton; - in { diff --git a/nixos/modules/services/ttys/kmscon.nix b/nixos/modules/services/ttys/kmscon.nix index 88e488425bced..59c45fcb44ee1 100644 --- a/nixos/modules/services/ttys/kmscon.nix +++ b/nixos/modules/services/ttys/kmscon.nix @@ -1,6 +1,6 @@ { config, pkgs, lib, ... }: let - inherit (lib) mkOption types mkIf optionalString; + inherit (lib) mkOption types mkIf; cfg = config.services.kmscon; diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index 4b9e561d53c80..17733aa7e4f64 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -7,7 +7,7 @@ let xcfg = config.services.xserver; cfg = xcfg.desktopManager.plasma5; - inherit (pkgs) kdeApplications plasma5 libsForQt5 qt5 xorg; + inherit (pkgs) kdeApplications plasma5 libsForQt5 qt5; in diff --git a/nixos/modules/services/x11/display-managers/lightdm-greeters/gtk.nix b/nixos/modules/services/x11/display-managers/lightdm-greeters/gtk.nix index 2a71d23386072..385f20b7e0662 100644 --- a/nixos/modules/services/x11/display-managers/lightdm-greeters/gtk.nix +++ b/nixos/modules/services/x11/display-managers/lightdm-greeters/gtk.nix @@ -8,7 +8,7 @@ let ldmcfg = dmcfg.lightdm; cfg = ldmcfg.greeters.gtk; - inherit (pkgs) stdenv lightdm writeScript writeText; + inherit (pkgs) writeText; theme = cfg.theme.package; icons = cfg.iconTheme.package; diff --git a/nixos/modules/services/x11/display-managers/lightdm.nix b/nixos/modules/services/x11/display-managers/lightdm.nix index 206ede227efa7..54d4520a0c8bf 100644 --- a/nixos/modules/services/x11/display-managers/lightdm.nix +++ b/nixos/modules/services/x11/display-managers/lightdm.nix @@ -13,7 +13,7 @@ let wmDefault = xcfg.windowManager.default; hasDefaultUserSession = dmDefault != "none" || wmDefault != "none"; - inherit (pkgs) stdenv lightdm writeScript writeText; + inherit (pkgs) lightdm writeScript writeText; # lightdm runs with clearenv(), but we need a few things in the enviornment for X to startup xserverWrapper = writeScript "xserver-wrapper" diff --git a/nixos/modules/services/x11/window-managers/openbox.nix b/nixos/modules/services/x11/window-managers/openbox.nix index 07ef77151e956..165772d1aa097 100644 --- a/nixos/modules/services/x11/window-managers/openbox.nix +++ b/nixos/modules/services/x11/window-managers/openbox.nix @@ -2,7 +2,6 @@ with lib; let - inherit (lib) mkOption mkIf; cfg = config.services.xserver.windowManager.openbox; in diff --git a/nixos/modules/services/x11/window-managers/wmii.nix b/nixos/modules/services/x11/window-managers/wmii.nix index 30c8df7822457..eec6f2b2b81b1 100644 --- a/nixos/modules/services/x11/window-managers/wmii.nix +++ b/nixos/modules/services/x11/window-managers/wmii.nix @@ -2,7 +2,6 @@ with lib; let - inherit (lib) mkOption mkIf singleton; cfg = config.services.xserver.windowManager.wmii; wmii = pkgs.wmii_hg; in |