Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / sb / sbctl / package.nix
blob75c752cc88496d09c672a2bceaffe617eb08113f
1 { lib
2 , buildGoModule
3 , fetchFromGitHub
4 , installShellFiles
5 , asciidoc
6 , databasePath ? "/etc/secureboot"
7 , nix-update-script
8 }:
10 buildGoModule rec {
11   pname = "sbctl";
12   version = "0.14";
14   src = fetchFromGitHub {
15     owner = "Foxboron";
16     repo = pname;
17     rev = version;
18     hash = "sha256-1TprUr+bLPOlMpe4ReV1S/QbVsA8Q7QIOcLczEaSyAQ=";
19   };
21   patches = [
22     ./fix-go-module.patch
23   ];
25   vendorHash = "sha256-LuSewWK/sxaHibJ6a05PM9CPen8J+MJD6lwk4SNOWSA=";
27   ldflags = [ "-s" "-w" "-X github.com/foxboron/sbctl.DatabasePath=${databasePath}" ];
29   nativeBuildInputs = [ installShellFiles asciidoc ];
31   postBuild = ''
32     make docs/sbctl.8
33   '';
35   postInstall = ''
36     installManPage docs/sbctl.8
38     installShellCompletion --cmd sbctl \
39     --bash <($out/bin/sbctl completion bash) \
40     --fish <($out/bin/sbctl completion fish) \
41     --zsh <($out/bin/sbctl completion zsh)
42   '';
44   passthru.updateScript = nix-update-script { };
46   meta = with lib; {
47     description = "Secure Boot key manager";
48     mainProgram = "sbctl";
49     homepage = "https://github.com/Foxboron/sbctl";
50     license = licenses.mit;
51     maintainers = with maintainers; [ raitobezarius ];
52     # go-uefi do not support darwin at the moment:
53     # see upstream on https://github.com/Foxboron/go-uefi/issues/13
54     platforms = platforms.linux;
55   };