nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 rustPlatform,
6 libtirpc,
7 pam,
8 rpcsvc-proto,
9 enablePAM ? stdenv.hostPlatform.isLinux,
10}:
11
12rustPlatform.buildRustPackage {
13 pname = "webdav-server-rs";
14 # The v0.4.0 tag cannot build. So we use the 547602e commit.
15 version = "unstable-2021-08-16";
16
17 src = fetchFromGitHub {
18 owner = "miquels";
19 repo = "webdav-server-rs";
20 rev = "547602e78783935b4ddd038fb795366c9c476bcc";
21 sha256 = "sha256-nTygUEjAUXD0mRTmjt8/UPVfZA4rP6oop1s/fI5mYeg=";
22 };
23
24 cargoHash = "sha256-0Ee0L3gKNP1O3SFkImBzQrT1fgnWFrrW8owxEM1dUYQ=";
25
26 buildInputs = [ libtirpc ] ++ lib.optional enablePAM pam;
27 nativeBuildInputs = [ rpcsvc-proto ];
28
29 buildNoDefaultFeatures = true;
30 buildFeatures = [ "quota" ] ++ lib.optional enablePAM "pam";
31
32 postPatch = ''
33 substituteInPlace fs_quota/build.rs \
34 --replace '/usr/include/tirpc' '${libtirpc.dev}/include/tirpc'
35 '';
36
37 meta = {
38 description = "Implementation of WebDAV server in Rust";
39 longDescription = ''
40 webdav-server-rs is an implementation of WebDAV with full support for
41 RFC4918. It also supports local unix accounts, PAM authentication, and
42 quota.
43 '';
44 homepage = "https://github.com/miquels/webdav-server-rs";
45 license = lib.licenses.asl20;
46 maintainers = with lib.maintainers; [ pmy ];
47 mainProgram = "webdav-server";
48 };
49}