nixpkgs/pkgs/servers/nfs-ganesha/default.nix
Ahmad Fatoum 7ea8d2b2be nfs-ganesha: add tools output for mount.9P helper
The nfs-ganesha mount.9P helper is a standalone shell script that makes
some aspects of mounting a 9P filesystem easier, e.g. instead of:

  mount -t 9p 192.168.10.2 /mnt -oaname=/home

it allows the familiar syntax:

  mount -t 9P 192.168.10.2:/home /mnt

As the mount helper is independent of the server, it's added as
separate output.
2024-02-18 14:57:59 +01:00

69 lines
1.4 KiB
Nix

{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
, krb5, xfsprogs, jemalloc, dbus, libcap
, ntirpc, liburcu, bison, flex, nfs-utils, acl
} :
stdenv.mkDerivation rec {
pname = "nfs-ganesha";
version = "5.7";
outputs = [ "out" "tools" ];
src = fetchFromGitHub {
owner = "nfs-ganesha";
repo = "nfs-ganesha";
rev = "V${version}";
sha256 = "sha256-4GYte9kPUR4kFHrUzHXtiMGbuRhZ+4iw1hmqi+geljc=";
};
preConfigure = "cd src";
cmakeFlags = [
"-DUSE_SYSTEM_NTIRPC=ON"
"-DSYSSTATEDIR=/var"
"-DENABLE_VFS_POSIX_ACL=ON"
"-DUSE_ACL_MAPPING=ON"
"-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON"
];
nativeBuildInputs = [
cmake
pkg-config
bison
flex
];
buildInputs = [
acl
krb5
xfsprogs
jemalloc
dbus.lib
libcap
ntirpc
liburcu
nfs-utils
];
postPatch = ''
substituteInPlace src/tools/mount.9P --replace "/bin/mount" "/usr/bin/env mount"
'';
postFixup = ''
patchelf --add-rpath $out/lib $out/bin/ganesha.nfsd
'';
postInstall = ''
install -Dm755 $src/src/tools/mount.9P $tools/bin/mount.9P
'';
meta = with lib; {
description = "NFS server that runs in user space";
homepage = "https://github.com/nfs-ganesha/nfs-ganesha/wiki";
maintainers = [ maintainers.markuskowa ];
platforms = platforms.linux;
license = licenses.lgpl3Plus;
mainProgram = "ganesha.nfsd";
outputsToInstall = [ "out" "tools" ];
};
}