nixpkgs/pkgs/by-name/sb/sbctl/package.nix
Pokey 5ed5fb6b9f sbctl: 0.16 -> 0.17, adoption
- Updated version to 0.17
- Fixed `hash` and `vendorHash`
- Removed nested `with` usage
- Set `mainProgram`
- Minor formatting cleanup

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
(cherry picked from commit 442d5ac1f0)
2025-06-08 16:21:42 +00:00

74 lines
1.7 KiB
Nix

{
lib,
buildGoModule,
stdenv,
fetchFromGitHub,
installShellFiles,
asciidoc,
databasePath ? "/etc/secureboot",
nix-update-script,
}:
buildGoModule rec {
pname = "sbctl";
version = "0.17";
src = fetchFromGitHub {
owner = "Foxboron";
repo = "sbctl";
tag = version;
hash = "sha256-7dCaWemkus2GHxILBEx5YvzdAmv89JfcPbqZZ6QwriI";
};
vendorHash = "sha256-gpHEJIbLnB0OiYB00rHK6OwrnHTHCj/tTVlUzuFjFKY=";
ldflags = [
"-s"
"-w"
"-X github.com/foxboron/sbctl.DatabasePath=${databasePath}"
"-X github.com/foxboron/sbctl.Version=${version}"
];
nativeBuildInputs = [
installShellFiles
asciidoc
];
postBuild = ''
make docs/sbctl.conf.5 docs/sbctl.8
'';
checkFlags = [
# https://github.com/Foxboron/sbctl/issues/343
"-skip"
"github.com/google/go-tpm-tools/.*"
];
postInstall =
''
installManPage docs/sbctl.conf.5 docs/sbctl.8
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd sbctl \
--bash <($out/bin/sbctl completion bash) \
--fish <($out/bin/sbctl completion fish) \
--zsh <($out/bin/sbctl completion zsh)
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Secure Boot key manager";
mainProgram = "sbctl";
homepage = "https://github.com/Foxboron/sbctl";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
Pokeylooted
raitobezarius
Scrumplex
];
# go-uefi does not support darwin at the moment:
# see upstream on https://github.com/Foxboron/go-uefi/issues/13
platforms = lib.platforms.linux;
};
}