1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-15 00:54:46 +00:00
nixpkgs/pkgs/os-specific/linux/ldm/default.nix

44 lines
977 B
Nix
Raw Normal View History

2021-01-15 14:45:37 +00:00
{ lib, stdenv, fetchgit, udev, util-linux, mountPath ? "/media/" }:
assert mountPath != "";
let
version = "0.5";
git = "https://github.com/LemonBoy/ldm.git";
in
stdenv.mkDerivation rec {
2019-08-13 22:52:01 +01:00
pname = "ldm";
inherit version;
# There is a stable release, but we'll use the lvm branch, which
# contains important fixes for LVM setups.
src = fetchgit {
url = meta.repositories.git;
rev = "refs/tags/v${version}";
sha256 = "0lxfypnbamfx6p9ar5k9wra20gvwn665l4pp2j4vsx4yi5q7rw2n";
};
2020-11-24 15:29:28 +00:00
buildInputs = [ udev util-linux ];
2016-02-22 00:21:26 +00:00
postPatch = ''
substituteInPlace ldm.c \
--replace "/mnt/" "${mountPath}"
sed '16i#include <sys/stat.h>' -i ldm.c
'';
buildFlags = [ "ldm" ];
installPhase = ''
mkdir -p $out/bin
cp -v ldm $out/bin
'';
meta = {
description = "A lightweight device mounter, with libudev as only dependency";
2021-01-15 14:45:37 +00:00
license = lib.licenses.mit;
2021-01-15 14:45:37 +00:00
platforms = lib.platforms.linux;
repositories.git = git;
};
}