From a26f11d23647cfd96ddb773ab896dbfa6027399a Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sun, 1 Oct 2023 04:20:00 +0000 Subject: [PATCH] dufs: install completions --- pkgs/servers/http/dufs/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/servers/http/dufs/default.nix b/pkgs/servers/http/dufs/default.nix index 77425c08b5ba..89058fd2171c 100644 --- a/pkgs/servers/http/dufs/default.nix +++ b/pkgs/servers/http/dufs/default.nix @@ -1,6 +1,7 @@ { lib , rustPlatform , fetchFromGitHub +, installShellFiles , stdenv , darwin }: @@ -18,6 +19,8 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-HZiWmqIh21b12DP+hnx1pWBWgSa5j71kp6GCRKGMHv0="; + nativeBuildInputs = [ installShellFiles ]; + buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; @@ -30,6 +33,13 @@ rustPlatform.buildRustPackage rec { "--skip=validate_printed_urls" ]; + postInstall = '' + installShellCompletion --cmd dufs \ + --bash <($out/bin/dufs --completions bash) \ + --fish <($out/bin/dufs --completions fish) \ + --zsh <($out/bin/dufs --completions zsh) + ''; + meta = with lib; { description = "A file server that supports static serving, uploading, searching, accessing control, webdav"; homepage = "https://github.com/sigoden/dufs";