Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

69 lines
1.6 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
hddtemp,
hdparm,
sdparm,
smartmontools,
makeWrapper,
installShellFiles,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "hddfancontrol";
version = "2.0.5";
src = fetchFromGitHub {
owner = "desbma";
repo = "hddfancontrol";
tag = finalAttrs.version;
hash = "sha256-kKzjg2D/7Thzu6JzmLyu2eJAr+N6Bi95WEBKrqB/vXo=";
};
cargoHash = "sha256-0TRNiRmxwV/p7nLOrU9GHjTzIaan4JV8C6e443nd2zY=";
nativeBuildInputs = [
makeWrapper
installShellFiles
];
postBuild = ''
mkdir -p target/man
cargo run --features gen-man-pages -- target/man
'';
postInstall = ''
mkdir -p $out/etc/systemd/system
substitute systemd/hddfancontrol.service $out/etc/systemd/system/hddfancontrol.service \
--replace-fail /usr/bin/hddfancontrol $out/bin/hddfancontrol
sed -i -e '/EnvironmentFile=.*/d' $out/etc/systemd/system/hddfancontrol.service
cd target/man
installManPage hddfancontrol-daemon.1 hddfancontrol-pwm-test.1 hddfancontrol.1
'';
postFixup = ''
wrapProgram $out/bin/hddfancontrol \
--prefix PATH : ${
lib.makeBinPath [
hddtemp
hdparm
sdparm
smartmontools
]
}
'';
meta = {
description = "Dynamically control fan speed according to hard drive temperature on Linux";
changelog = "https://github.com/desbma/hddfancontrol/releases/tag/${finalAttrs.version}";
homepage = "https://github.com/desbma/hddfancontrol";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [
benley
philipwilk
];
mainProgram = "hddfancontrol";
};
})