2022-09-09 14:08:57 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, asciidoc
|
|
|
|
, databasePath ? "/etc/secureboot"
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "sbctl";
|
2023-03-27 19:17:25 +00:00
|
|
|
version = "0.11";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Foxboron";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-03-27 19:17:25 +00:00
|
|
|
hash = "sha256-kApPb8X1JCP1XfyVFcoCDd+yrytTKSkNWRHKDA3mGaQ=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
vendorHash = "sha256-WbPYTETTOzqWH+q6fzyDgm0wMScbLWlksLxkDjopF4E=";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
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 ];
|
2022-11-04 12:27:35 +00:00
|
|
|
# go-uefi do not support darwin at the moment:
|
|
|
|
# see upstream on https://github.com/Foxboron/go-uefi/issues/13
|
|
|
|
platforms = platforms.linux;
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
}
|