nixpkgs/pkgs/servers/http/dufs/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.4 KiB
Nix
Raw Normal View History

{ lib
, rustPlatform
, fetchFromGitHub
2023-10-01 06:20:00 +02:00
, installShellFiles
, stdenv
, darwin
}:
2022-09-15 09:38:26 +02:00
rustPlatform.buildRustPackage rec {
pname = "dufs";
version = "0.40.0";
2022-09-15 09:38:26 +02:00
src = fetchFromGitHub {
owner = "sigoden";
repo = "dufs";
2022-09-15 09:38:26 +02:00
rev = "v${version}";
hash = "sha256-BoFoF7V6bTQiJ+afGnivviU/s2ikOxAX06s+AwRxo8Q=";
2022-09-15 09:38:26 +02:00
};
cargoHash = "sha256-B0K/lco7suYM0/02LaDbeqyt4zyiwoeBxhmUPsVTvkw=";
2022-09-15 09:38:26 +02:00
2023-10-01 06:20:00 +02:00
nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
2022-09-15 09:38:26 +02:00
];
2022-12-15 09:14:44 +01: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 17:14:36 +01:00
checkFlags = [
# tests depend on network interface, may fail with virtual IPs.
"--skip=validate_printed_urls"
];
2023-10-01 06:20:00 +02: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 09:38:26 +02:00
meta = with lib; {
description = "A file server that supports static serving, uploading, searching, accessing control, webdav";
mainProgram = "dufs";
2022-09-15 09:38:26 +02:00
homepage = "https://github.com/sigoden/dufs";
changelog = "https://github.com/sigoden/dufs/blob/${src.rev}/CHANGELOG.md";
2022-09-15 09:38:26 +02:00
license = with licenses; [ asl20 /* or */ mit ];
maintainers = with maintainers; [ figsoda holymonson ];
2022-09-15 09:38:26 +02:00
};
}