2013-11-10 14:30:01 +01:00
|
|
|
{ stdenv, fetchgit, udev, utillinux, mountPath ? "/media/" }:
|
|
|
|
|
|
|
|
assert mountPath != "";
|
|
|
|
|
|
|
|
let
|
2014-03-04 12:44:15 +01:00
|
|
|
version = "v0.4.2";
|
|
|
|
git = https://github.com/LemonBoy/ldm.git;
|
2013-11-10 14:30:01 +01:00
|
|
|
in
|
2014-03-04 12:44:15 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ldm-${version}";
|
2013-11-10 14:30:01 +01: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 12:44:15 +01:00
|
|
|
url = meta.repositories.git;
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
sha256 = "1fdm3l00csjyvz40py6wlsh8s441rbp4az3sc2i14ag7srh2yim8";
|
2013-11-10 14:30:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ udev utillinux ];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
substituteInPlace ldm.c \
|
|
|
|
--replace "/mnt/" "${mountPath}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -v ldm $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A lightweight device mounter, with libudev as only dependency";
|
|
|
|
license = "MIT";
|
|
|
|
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.the-kenny ];
|
2014-03-04 12:44:15 +01:00
|
|
|
repositories.git = git;
|
2013-11-10 14:30:01 +01:00
|
|
|
};
|
|
|
|
}
|