2023-08-22 20:05:09 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2023-10-09 19:29:22 +00:00
|
|
|
, installShellFiles
|
2023-08-22 20:05:09 +00:00
|
|
|
, stdenv
|
|
|
|
, darwin
|
|
|
|
}:
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "dufs";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.38.0";
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sigoden";
|
2023-10-09 19:29:22 +00:00
|
|
|
repo = "dufs";
|
2022-09-30 11:47:45 +00:00
|
|
|
rev = "v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-YPEJP+RdGxEMVRoDohxGiOkOMmWLhlBrkr+T+zcST5g=";
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
cargoHash = "sha256-Dia0/yV2rsUx0Mfd2rQkNh7QB+dZubudcoyfMmeaxx8=";
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
2023-08-22 20:05:09 +00:00
|
|
|
darwin.apple_sdk.frameworks.Security
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
# FIXME: checkPhase on darwin will leave some zombie spawn processes
|
|
|
|
# see https://github.com/NixOS/nixpkgs/issues/205620
|
|
|
|
doCheck = !stdenv.isDarwin;
|
2022-12-17 10:02:37 +00:00
|
|
|
checkFlags = [
|
|
|
|
# tests depend on network interface, may fail with virtual IPs.
|
|
|
|
"--skip=validate_printed_urls"
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd dufs \
|
|
|
|
--bash <($out/bin/dufs --completions bash) \
|
|
|
|
--fish <($out/bin/dufs --completions fish) \
|
|
|
|
--zsh <($out/bin/dufs --completions zsh)
|
|
|
|
'';
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A file server that supports static serving, uploading, searching, accessing control, webdav";
|
|
|
|
homepage = "https://github.com/sigoden/dufs";
|
2023-08-22 20:05:09 +00:00
|
|
|
changelog = "https://github.com/sigoden/dufs/blob/${src.rev}/CHANGELOG.md";
|
2022-09-30 11:47:45 +00:00
|
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
2023-08-22 20:05:09 +00:00
|
|
|
maintainers = with maintainers; [ figsoda holymonson ];
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
}
|