1{ lib, fetchFromGitHub, installShellFiles, buildGoModule }:
2
3buildGoModule rec {
4 pname = "autorestic";
5 version = "1.7.7";
6
7 src = fetchFromGitHub {
8 owner = "cupcakearmy";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "sha256-drinKUJAlgY1PEP7NHOFfmvDVib1AFjT8hRktQgxJ4A=";
12 };
13
14 vendorHash = "sha256-K3+5DRXcx56sJ4XHikVtmoxmpJbBeAgPkN9KtHVgvYA=";
15
16 nativeBuildInputs = [ installShellFiles ];
17
18 postInstall = ''
19 installShellCompletion --cmd autorestic \
20 --bash <($out/bin/autorestic completion bash) \
21 --fish <($out/bin/autorestic completion fish) \
22 --zsh <($out/bin/autorestic completion zsh)
23 '';
24
25 meta = with lib; {
26 description = "High level CLI utility for restic";
27 homepage = "https://github.com/cupcakearmy/autorestic";
28 license = licenses.asl20;
29 maintainers = with maintainers; [ renesat ];
30 mainProgram = "autorestic";
31 };
32}