summary refs log tree commit diff
path: root/pkgs/os-specific/linux/hd-idle
diff options
context:
space:
mode:
authorYureka <yuka@yuka.dev>2021-10-31 12:22:45 +0100
committerRobert Helgesson <robert@rycee.net>2021-11-01 23:55:57 +0100
commit670af1fba859ae2834325b4e764fb3c3d08b662a (patch)
treea51800e11011d900b4a4b8c427da10be7d7bec09 /pkgs/os-specific/linux/hd-idle
parentbf873fbb2f461f1897335debcffbde67e3e83f44 (diff)
downloadnixpkgs-670af1fba859ae2834325b4e764fb3c3d08b662a.tar
nixpkgs-670af1fba859ae2834325b4e764fb3c3d08b662a.tar.gz
nixpkgs-670af1fba859ae2834325b4e764fb3c3d08b662a.tar.bz2
nixpkgs-670af1fba859ae2834325b4e764fb3c3d08b662a.tar.lz
nixpkgs-670af1fba859ae2834325b4e764fb3c3d08b662a.tar.xz
nixpkgs-670af1fba859ae2834325b4e764fb3c3d08b662a.tar.zst
nixpkgs-670af1fba859ae2834325b4e764fb3c3d08b662a.zip
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.
Diffstat (limited to 'pkgs/os-specific/linux/hd-idle')
-rw-r--r--pkgs/os-specific/linux/hd-idle/default.nix29
1 files changed, 16 insertions, 13 deletions
diff --git a/pkgs/os-specific/linux/hd-idle/default.nix b/pkgs/os-specific/linux/hd-idle/default.nix
index 301a218ff62..a1f355a849c 100644
--- a/pkgs/os-specific/linux/hd-idle/default.nix
+++ b/pkgs/os-specific/linux/hd-idle/default.nix
@@ -1,25 +1,28 @@
-{ lib, stdenv, fetchurl }:
+{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
 
-stdenv.mkDerivation rec {
+buildGoModule rec {
   pname = "hd-idle";
-  version = "1.05";
+  version = "1.16";
 
-  src = fetchurl {
-    url = "mirror://sourceforge/project/hd-idle/hd-idle-${version}.tgz";
-    sha256 = "031sm996s0rhy3z91b9xvyimsj2yd2fhsww2al2hxda5s5wzxzjf";
+  src = fetchFromGitHub {
+    owner = "adelolmo";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-LZcMwF/BhHiWWXMcrzbk8GyvwXdA3B2olmbOBxQwV5g=";
   };
 
-  prePatch = ''
-    substituteInPlace Makefile \
-      --replace "-g root -o root" ""
-  '';
+  vendorSha256 = null;
+
+  nativeBuildInputs = [ installShellFiles ];
 
-  installFlags = [ "TARGET_DIR=$(out)" ];
+  postInstall = ''
+    installManPage debian/hd-idle.8
+  '';
 
   meta = with lib; {
     description = "Spins down external disks after a period of idle time";
-    homepage = "http://hd-idle.sourceforge.net/";
-    license = licenses.gpl2Plus;
+    homepage = "https://github.com/adelolmo/hd-idle";
+    license = licenses.gpl3Plus;
     platforms = platforms.linux;
     maintainers = [ maintainers.rycee ];
   };