summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
authorPeng Mei Yu <pmy@xqzp.net>2021-11-21 13:01:45 +0800
committerPeng Mei Yu <pmy@xqzp.net>2021-11-30 10:19:12 +0800
commit34ec1a380a6897ffe631aabe0612c367a5bb3727 (patch)
treec859aa89da865a2ebce5594b28f39f95678767b5 /pkgs/servers
parent640e54cda9166b43e2b53f876dee8145834b0765 (diff)
downloadnixpkgs-34ec1a380a6897ffe631aabe0612c367a5bb3727.tar
nixpkgs-34ec1a380a6897ffe631aabe0612c367a5bb3727.tar.gz
nixpkgs-34ec1a380a6897ffe631aabe0612c367a5bb3727.tar.bz2
nixpkgs-34ec1a380a6897ffe631aabe0612c367a5bb3727.tar.lz
nixpkgs-34ec1a380a6897ffe631aabe0612c367a5bb3727.tar.xz
nixpkgs-34ec1a380a6897ffe631aabe0612c367a5bb3727.tar.zst
nixpkgs-34ec1a380a6897ffe631aabe0612c367a5bb3727.zip
webdav-server-rs: init at unstable-2021-08-16
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/webdav-server-rs/default.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/servers/webdav-server-rs/default.nix b/pkgs/servers/webdav-server-rs/default.nix
new file mode 100644
index 00000000000..06c8716ba87
--- /dev/null
+++ b/pkgs/servers/webdav-server-rs/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, rustPlatform
+, libtirpc
+, pam
+, rpcsvc-proto
+, enablePAM ? stdenv.isLinux
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "webdav-server-rs";
+  # The v0.4.0 tag cannot build.  So we use the 547602e commit.
+  version = "unstable-2021-08-16";
+
+  src = fetchFromGitHub {
+    owner = "miquels";
+    repo = pname;
+    rev = "547602e78783935b4ddd038fb795366c9c476bcc";
+    sha256 = "sha256-nTygUEjAUXD0mRTmjt8/UPVfZA4rP6oop1s/fI5mYeg=";
+  };
+
+  cargoHash = "sha256-TDDfGQig4i/DpsilTPqMQ1oT0mXK5DKlZmwsPPLrzFc=";
+
+  buildInputs = [ libtirpc ] ++ lib.optional enablePAM pam;
+  nativeBuildInputs = [ rpcsvc-proto ];
+
+  buildNoDefaultFeatures = true;
+  buildFeatures = [ "quota" ] ++ lib.optional enablePAM "pam";
+
+  postPatch = ''
+    substituteInPlace fs_quota/build.rs \
+       --replace '/usr/include/tirpc' '${libtirpc.dev}/include/tirpc'
+  '';
+
+  meta = with lib; {
+    description = "An implementation of WebDAV server in Rust";
+    longDescription = ''
+      webdav-server-rs is an implementation of WebDAV with full support for
+      RFC4918.  It also supports local unix accounts, PAM authentication, and
+      quota.
+    '';
+    homepage = "https://github.com/miquels/webdav-server-rs";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ pmy ];
+  };
+}