2013-11-10 13:30:01 +00:00
|
|
|
{ stdenv, fetchgit, udev, utillinux, mountPath ? "/media/" }:
|
|
|
|
|
|
|
|
assert mountPath != "";
|
|
|
|
|
|
|
|
let
|
2014-08-12 12:52:48 +01:00
|
|
|
version = "0.5";
|
2014-03-04 11:44:15 +00:00
|
|
|
git = https://github.com/LemonBoy/ldm.git;
|
2013-11-10 13:30:01 +00:00
|
|
|
in
|
2014-03-04 11:44:15 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ldm-${version}";
|
2013-11-10 13:30:01 +00:00
|
|
|
|
|
|
|
# There is a stable release, but we'll use the lvm branch, which
|
|
|
|
# contains important fixes for LVM setups.
|
|
|
|
src = fetchgit {
|
2014-03-04 11:44:15 +00:00
|
|
|
url = meta.repositories.git;
|
2014-08-12 12:52:48 +01:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
sha256 = "0kkby3a0xgh1lmkbzpsi4am2rqjv3ccgdpic99aw1c76y0ca837y";
|
2013-11-10 13:30:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ udev utillinux ];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
substituteInPlace ldm.c \
|
|
|
|
--replace "/mnt/" "${mountPath}"
|
|
|
|
'';
|
|
|
|
|
2014-08-12 12:52:48 +01:00
|
|
|
buildPhase = "make ldm";
|
|
|
|
|
2013-11-10 13:30:01 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -v ldm $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A lightweight device mounter, with libudev as only dependency";
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.mit;
|
2013-11-10 13:30:01 +00:00
|
|
|
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.the-kenny ];
|
2014-03-04 11:44:15 +00:00
|
|
|
repositories.git = git;
|
2013-11-10 13:30:01 +00:00
|
|
|
};
|
|
|
|
}
|