2021-07-01 05:14:58 +02:00
|
|
|
{ lib, stdenv, fetchFromGitHub, intltool, glib, pkg-config, udev, util-linux, acl }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "udevil";
|
|
|
|
version = "0.4.4";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "IgnorantGuru";
|
|
|
|
repo = "udevil";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0nd44r8rbxifx4x4m24z5aji1c6k1fhw8cmf5s43wd5qys0bcdad";
|
2015-07-19 14:21:30 +02:00
|
|
|
};
|
2021-07-01 05:14:58 +02:00
|
|
|
|
2021-01-17 03:09:27 +01:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2021-07-01 05:14:58 +02:00
|
|
|
|
2017-09-05 23:26:13 +02:00
|
|
|
buildInputs = [ intltool glib udev ];
|
2021-07-01 05:14:58 +02:00
|
|
|
|
2015-07-19 14:21:30 +02:00
|
|
|
configurePhase = ''
|
|
|
|
substituteInPlace src/Makefile.in --replace "-o root -g root" ""
|
2017-06-17 11:47:42 +02:00
|
|
|
# do not set setuid bit in nix store
|
2017-06-16 13:54:39 +02:00
|
|
|
substituteInPlace src/Makefile.in --replace 4755 0755
|
2015-07-19 14:21:30 +02:00
|
|
|
./configure \
|
|
|
|
--prefix=$out \
|
2020-11-24 16:29:28 +01:00
|
|
|
--with-mount-prog=${util-linux}/bin/mount \
|
|
|
|
--with-umount-prog=${util-linux}/bin/umount \
|
|
|
|
--with-losetup-prog=${util-linux}/bin/losetup \
|
2016-02-01 19:45:55 +01:00
|
|
|
--with-setfacl-prog=${acl.bin}/bin/setfacl \
|
2015-07-19 14:21:30 +02:00
|
|
|
--sysconfdir=$prefix/etc
|
|
|
|
'';
|
2021-07-01 05:14:58 +02:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
substituteInPlace $out/lib/systemd/system/devmon@.service \
|
|
|
|
--replace /usr/bin/devmon "$out/bin/devmon"
|
|
|
|
'';
|
|
|
|
|
2015-12-14 12:49:14 +01:00
|
|
|
patches = [ ./device-info-sys-stat.patch ];
|
2021-07-01 05:14:58 +02:00
|
|
|
|
|
|
|
meta = with lib; {
|
2015-07-19 14:21:30 +02:00
|
|
|
description = "A command line Linux program which mounts and unmounts removable devices without a password, shows device info, and monitors device changes";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://ignorantguru.github.io/udevil/";
|
2021-07-01 05:14:58 +02:00
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl3Plus;
|
2015-07-19 14:21:30 +02:00
|
|
|
};
|
|
|
|
}
|