nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 installShellFiles,
6 stdenv,
7}:
8
9rustPlatform.buildRustPackage rec {
10 pname = "dufs";
11 version = "0.45.0";
12
13 src = fetchFromGitHub {
14 owner = "sigoden";
15 repo = "dufs";
16 rev = "v${version}";
17 hash = "sha256-83lFnT4eRYaBe4e2o6l6AGQycm/oK96n5DXutBNvBsE=";
18 };
19
20 cargoHash = "sha256-WdjqG2URtloh5OnpBBnEWHD3WKGkCKLDcCyWRVGIXto=";
21
22 nativeBuildInputs = [ installShellFiles ];
23
24 __darwinAllowLocalNetworking = true;
25
26 checkFlags = [
27 # tests depend on network interface, may fail with virtual IPs.
28 "--skip=validate_printed_urls"
29 ];
30
31 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
32 installShellCompletion --cmd dufs \
33 --bash <($out/bin/dufs --completions bash) \
34 --fish <($out/bin/dufs --completions fish) \
35 --zsh <($out/bin/dufs --completions zsh)
36 '';
37
38 meta = {
39 description = "File server that supports static serving, uploading, searching, accessing control, webdav";
40 mainProgram = "dufs";
41 homepage = "https://github.com/sigoden/dufs";
42 changelog = "https://github.com/sigoden/dufs/blob/${src.rev}/CHANGELOG.md";
43 license = with lib.licenses; [
44 asl20 # or
45 mit
46 ];
47 maintainers = with lib.maintainers; [
48 holymonson
49 ];
50 };
51}