nixpkgs/pkgs/by-name/hd/hddfancontrol/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

38 lines
1.1 KiB
Nix

{ lib, python3Packages, fetchFromGitHub, hddtemp, hdparm, smartmontools, nixosTests }:
python3Packages.buildPythonPackage rec {
pname = "hddfancontrol";
version = "1.5.1";
src = fetchFromGitHub {
owner = "desbma";
repo = pname;
rev = version;
sha256 = "0b2grf98qnikayn18xll01dkm5pjpcjxdffgx1nyw9s0gqig8dg0";
};
propagatedBuildInputs = [
python3Packages.python-daemon
hddtemp
hdparm
smartmontools
];
postInstall = ''
mkdir -p $out/etc/systemd/system
substitute systemd/hddfancontrol.service $out/etc/systemd/system/hddfancontrol.service \
--replace /usr/bin/hddfancontrol $out/bin/hddfancontrol
sed -i -e '/EnvironmentFile=.*/d' $out/etc/systemd/system/hddfancontrol.service
'';
passthru.tests = { inherit (nixosTests) hddfancontrol; };
meta = with lib; {
description = "Dynamically control fan speed according to hard drive temperature on Linux";
homepage = "https://github.com/desbma/hddfancontrol";
license = licenses.gpl3Only;
maintainers = with maintainers; [ benley ];
mainProgram = "hddfancontrol";
};
}