aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/applications/misc/udevil/default.nix
blob: dbf721888df6d4c0b8b465f9c7e6ec87781eeedc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ stdenv, fetchurl, intltool, glib, pkgconfig, udev, utillinux, acl }:
stdenv.mkDerivation {
  name = "udevil-0.4.4";
  src = fetchurl {
    url = "https://github.com/IgnorantGuru/udevil/archive/0.4.4.tar.gz";
    sha256 = "0z1bhaayambrcn7bgnrqk445k50ifabmw8q4i9qj49nnbcvxhbxd";
  };
  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ intltool glib udev ];
  configurePhase = ''
    substituteInPlace src/Makefile.in --replace "-o root -g root" ""
    # do not set setuid bit in nix store
    substituteInPlace src/Makefile.in --replace 4755 0755
    ./configure \
      --prefix=$out \
      --with-mount-prog=${utillinux}/bin/mount \
      --with-umount-prog=${utillinux}/bin/umount \
      --with-losetup-prog=${utillinux}/bin/losetup \
      --with-setfacl-prog=${acl.bin}/bin/setfacl \
      --sysconfdir=$prefix/etc
  '';
  patches = [ ./device-info-sys-stat.patch ];
  meta = {
    description = "A command line Linux program which mounts and unmounts removable devices without a password, shows device info, and monitors device changes";
    homepage = "https://ignorantguru.github.io/udevil/";
    platforms = stdenv.lib.platforms.linux;
    license = stdenv.lib.licenses.gpl3;
  };
}