about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/ldm
diff options
context:
space:
mode:
authorMoritz Ulrich <moritz@tarn-vedra.de>2013-11-10 14:30:01 +0100
committerMoritz Ulrich <moritz@tarn-vedra.de>2013-11-10 15:08:44 +0100
commit7fded05cbea79152103e73df2fcbb405ef64e234 (patch)
tree54ab43893b4ea9788e410dcbb6768c4aac50d216 /pkgs/os-specific/linux/ldm
parentb9f5b880e7893227b13c707d03bbafaf0f620855 (diff)
New package: LDM - Lightweight device mounter
Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Diffstat (limited to 'pkgs/os-specific/linux/ldm')
-rw-r--r--pkgs/os-specific/linux/ldm/default.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/ldm/default.nix b/pkgs/os-specific/linux/ldm/default.nix
new file mode 100644
index 0000000000000..df98b5260c6b7
--- /dev/null
+++ b/pkgs/os-specific/linux/ldm/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchgit, udev, utillinux, mountPath ? "/media/" }:
+
+assert mountPath != "";
+
+let
+  name = "ldm-0.4.2";
+in
+stdenv.mkDerivation {
+  inherit name;
+
+  # There is a stable release, but we'll use the lvm branch, which
+  # contains important fixes for LVM setups.
+  src = fetchgit {
+    url = "https://github.com/LemonBoy/ldm.git";
+    rev = "26633ce07b";
+    sha256 = "bb733d3b9b3bd5843b9cf1507a04a063c5aa45b398480411709fc727ae10b8b1";
+  };
+
+  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 ];
+  };
+}