2023-08-15 00:44:04 +01:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2023-10-01 05:20:00 +01:00
|
|
|
, installShellFiles
|
2023-08-15 00:44:04 +01:00
|
|
|
, stdenv
|
|
|
|
, darwin
|
|
|
|
}:
|
2022-09-15 08:38:26 +01:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "dufs";
|
2024-02-13 04:46:32 +00:00
|
|
|
version = "0.40.0";
|
2022-09-15 08:38:26 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sigoden";
|
2023-08-24 14:29:28 +01:00
|
|
|
repo = "dufs";
|
2022-09-15 08:38:26 +01:00
|
|
|
rev = "v${version}";
|
2024-02-13 04:46:32 +00:00
|
|
|
hash = "sha256-BoFoF7V6bTQiJ+afGnivviU/s2ikOxAX06s+AwRxo8Q=";
|
2022-09-15 08:38:26 +01:00
|
|
|
};
|
|
|
|
|
2024-02-13 04:46:32 +00:00
|
|
|
cargoHash = "sha256-B0K/lco7suYM0/02LaDbeqyt4zyiwoeBxhmUPsVTvkw=";
|
2022-09-15 08:38:26 +01:00
|
|
|
|
2023-10-01 05:20:00 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2023-08-24 14:29:28 +01:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
2023-08-15 00:44:04 +01:00
|
|
|
darwin.apple_sdk.frameworks.Security
|
2022-09-15 08:38:26 +01:00
|
|
|
];
|
|
|
|
|
2022-12-15 08:14:44 +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-05 16:14:36 +00:00
|
|
|
checkFlags = [
|
|
|
|
# tests depend on network interface, may fail with virtual IPs.
|
|
|
|
"--skip=validate_printed_urls"
|
|
|
|
];
|
|
|
|
|
2023-10-01 05:20:00 +01: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-15 08:38:26 +01: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-15 00:44:04 +01:00
|
|
|
changelog = "https://github.com/sigoden/dufs/blob/${src.rev}/CHANGELOG.md";
|
2022-09-15 08:38:26 +01:00
|
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
2023-08-15 00:44:04 +01:00
|
|
|
maintainers = with maintainers; [ figsoda holymonson ];
|
2022-09-15 08:38:26 +01:00
|
|
|
};
|
|
|
|
}
|