hd-idle: package rewrite

Someone ported the original hd-idle to Golang and is maintaining it.
This replaces the hd-idle package with the actively maintained Golang
port. I assume nobody will need unmaintained original version since
the Golang port can do everything the original version can do.

authored by Yureka and committed by Robert Helgesson 670af1fb bf873fbb

+16 -13
+16 -13
pkgs/os-specific/linux/hd-idle/default.nix
··· 1 - { lib, stdenv, fetchurl }: 1 + { lib, buildGoModule, fetchFromGitHub, installShellFiles }: 2 2 3 - stdenv.mkDerivation rec { 3 + buildGoModule rec { 4 4 pname = "hd-idle"; 5 - version = "1.05"; 5 + version = "1.16"; 6 6 7 - src = fetchurl { 8 - url = "mirror://sourceforge/project/hd-idle/hd-idle-${version}.tgz"; 9 - sha256 = "031sm996s0rhy3z91b9xvyimsj2yd2fhsww2al2hxda5s5wzxzjf"; 7 + src = fetchFromGitHub { 8 + owner = "adelolmo"; 9 + repo = pname; 10 + rev = "v${version}"; 11 + sha256 = "sha256-LZcMwF/BhHiWWXMcrzbk8GyvwXdA3B2olmbOBxQwV5g="; 10 12 }; 11 13 12 - prePatch = '' 13 - substituteInPlace Makefile \ 14 - --replace "-g root -o root" "" 15 - ''; 14 + vendorSha256 = null; 16 15 17 - installFlags = [ "TARGET_DIR=$(out)" ]; 16 + nativeBuildInputs = [ installShellFiles ]; 17 + 18 + postInstall = '' 19 + installManPage debian/hd-idle.8 20 + ''; 18 21 19 22 meta = with lib; { 20 23 description = "Spins down external disks after a period of idle time"; 21 - homepage = "http://hd-idle.sourceforge.net/"; 22 - license = licenses.gpl2Plus; 24 + homepage = "https://github.com/adelolmo/hd-idle"; 25 + license = licenses.gpl3Plus; 23 26 platforms = platforms.linux; 24 27 maintainers = [ maintainers.rycee ]; 25 28 };