about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/sbctl/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/security/sbctl/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/security/sbctl/default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/security/sbctl/default.nix b/nixpkgs/pkgs/tools/security/sbctl/default.nix
new file mode 100644
index 000000000000..6471425a8581
--- /dev/null
+++ b/nixpkgs/pkgs/tools/security/sbctl/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, installShellFiles
+, asciidoc
+, databasePath ? "/etc/secureboot"
+}:
+
+buildGoModule rec {
+  pname = "sbctl";
+  version = "0.11";
+
+  src = fetchFromGitHub {
+    owner = "Foxboron";
+    repo = pname;
+    rev = version;
+    hash = "sha256-kApPb8X1JCP1XfyVFcoCDd+yrytTKSkNWRHKDA3mGaQ=";
+  };
+
+  vendorHash = "sha256-WbPYTETTOzqWH+q6fzyDgm0wMScbLWlksLxkDjopF4E=";
+
+  ldflags = [ "-s" "-w" "-X github.com/foxboron/sbctl.DatabasePath=${databasePath}" ];
+
+  nativeBuildInputs = [ installShellFiles asciidoc ];
+
+  postBuild = ''
+    make docs/sbctl.8
+  '';
+
+  postInstall = ''
+    installManPage docs/sbctl.8
+
+    installShellCompletion --cmd sbctl \
+    --bash <($out/bin/sbctl completion bash) \
+    --fish <($out/bin/sbctl completion fish) \
+    --zsh <($out/bin/sbctl completion zsh)
+  '';
+
+  meta = with lib; {
+    description = "Secure Boot key manager";
+    homepage = "https://github.com/Foxboron/sbctl";
+    license = licenses.mit;
+    maintainers = with maintainers; [ raitobezarius ];
+    # go-uefi do not support darwin at the moment:
+    # see upstream on https://github.com/Foxboron/go-uefi/issues/13
+    platforms = platforms.linux;
+  };
+}