Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1f409d0879e4
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f60459a023a7
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Feb 3, 2019

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    1278615 View commit details

Commits on Mar 5, 2019

  1. Merge pull request #55142 from FlorianFranzen/thinkfan_smart

    thinkfan: add option for libatasmart support
    domenkozar authored Mar 5, 2019
    Copy the full SHA
    f60459a View commit details
Showing with 21 additions and 6 deletions.
  1. +15 −5 nixos/modules/services/hardware/thinkfan.nix
  2. +6 −1 pkgs/tools/system/thinkfan/default.nix
20 changes: 15 additions & 5 deletions nixos/modules/services/hardware/thinkfan.nix
Original file line number Diff line number Diff line change
@@ -47,6 +47,8 @@ let
${cfg.levels}
'';

thinkfan = pkgs.thinkfan.override { smartSupport = cfg.smartSupport; };

in {

options = {
@@ -61,6 +63,15 @@ in {
'';
};

smartSupport = mkOption {
type = types.bool;
default = false;
description = ''
Whether to build thinkfan with SMART support to read temperatures
directly from hard disks.
'';
};

sensors = mkOption {
type = types.lines;
default = ''
@@ -77,7 +88,7 @@ in {
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)
S.M.A.R.T. (requires smartSupport to be enabled)
Which reads the temperature directly from the hard
disk using libatasmart (keyword atasmart)
@@ -125,18 +136,17 @@ in {

config = mkIf cfg.enable {

environment.systemPackages = [ pkgs.thinkfan ];
environment.systemPackages = [ thinkfan ];

systemd.services.thinkfan = {
description = "Thinkfan";
after = [ "basic.target" ];
wantedBy = [ "multi-user.target" ];
path = [ pkgs.thinkfan ];
serviceConfig.ExecStart = "${pkgs.thinkfan}/bin/thinkfan -n -c ${configFile}";
path = [ thinkfan ];
serviceConfig.ExecStart = "${thinkfan}/bin/thinkfan -n -c ${configFile}";
};

boot.extraModprobeConfig = "options thinkpad_acpi experimental=1 fan_control=1";

};

}
7 changes: 6 additions & 1 deletion pkgs/tools/system/thinkfan/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ stdenv, fetchurl, cmake }:
{ stdenv, fetchurl, cmake
, smartSupport ? false, libatasmart }:

stdenv.mkDerivation rec {
name = "thinkfan-${version}";
@@ -11,6 +12,10 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ cmake ];

buildInputs = stdenv.lib.optional smartSupport libatasmart;

cmakeFlags = stdenv.lib.optional smartSupport "-DUSE_ATASMART=ON";

installPhase = ''
install -Dm755 {.,$out/bin}/thinkfan