2024-11-09 13:13:41 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildGoModule,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
installShellFiles,
|
|
|
|
asciidoc,
|
|
|
|
databasePath ? "/etc/secureboot",
|
|
|
|
nix-update-script,
|
2022-08-21 17:55:34 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "sbctl";
|
2025-05-10 18:59:03 -04:00
|
|
|
version = "0.17";
|
2022-08-21 17:55:34 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Foxboron";
|
2024-11-09 13:30:33 +01:00
|
|
|
repo = "sbctl";
|
2025-01-03 21:24:13 +01:00
|
|
|
tag = version;
|
2025-05-10 18:59:03 -04:00
|
|
|
hash = "sha256-7dCaWemkus2GHxILBEx5YvzdAmv89JfcPbqZZ6QwriI";
|
2022-08-21 17:55:34 +02:00
|
|
|
};
|
|
|
|
|
2025-05-10 18:59:03 -04:00
|
|
|
vendorHash = "sha256-gpHEJIbLnB0OiYB00rHK6OwrnHTHCj/tTVlUzuFjFKY=";
|
2022-08-21 17:55:34 +02:00
|
|
|
|
2024-11-09 13:13:41 +01:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/foxboron/sbctl.DatabasePath=${databasePath}"
|
|
|
|
"-X github.com/foxboron/sbctl.Version=${version}"
|
|
|
|
];
|
2022-08-21 17:55:34 +02:00
|
|
|
|
2024-11-09 13:13:41 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
asciidoc
|
|
|
|
];
|
2022-08-21 17:55:34 +02:00
|
|
|
|
|
|
|
postBuild = ''
|
2024-08-05 18:24:45 +02:00
|
|
|
make docs/sbctl.conf.5 docs/sbctl.8
|
2022-08-21 17:55:34 +02:00
|
|
|
'';
|
|
|
|
|
2024-08-05 18:24:45 +02:00
|
|
|
checkFlags = [
|
|
|
|
# https://github.com/Foxboron/sbctl/issues/343
|
2024-11-09 13:13:41 +01:00
|
|
|
"-skip"
|
|
|
|
"github.com/google/go-tpm-tools/.*"
|
2024-08-05 18:24:45 +02:00
|
|
|
];
|
|
|
|
|
2024-11-09 13:13:41 +01:00
|
|
|
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)
|
|
|
|
'';
|
2022-08-21 17:55:34 +02:00
|
|
|
|
2024-05-25 15:36:18 +02:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2025-05-10 18:59:03 -04:00
|
|
|
meta = {
|
2022-08-21 17:55:34 +02:00
|
|
|
description = "Secure Boot key manager";
|
2024-03-19 03:14:51 +01:00
|
|
|
mainProgram = "sbctl";
|
2022-08-21 17:55:34 +02:00
|
|
|
homepage = "https://github.com/Foxboron/sbctl";
|
2025-05-10 18:59:03 -04:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
Pokeylooted
|
2024-11-09 13:13:41 +01:00
|
|
|
raitobezarius
|
|
|
|
Scrumplex
|
|
|
|
];
|
2025-05-10 18:59:03 -04:00
|
|
|
# go-uefi does not support darwin at the moment:
|
2022-11-06 23:59:08 +01:00
|
|
|
# see upstream on https://github.com/Foxboron/go-uefi/issues/13
|
2025-05-10 18:59:03 -04:00
|
|
|
platforms = lib.platforms.linux;
|
2022-08-21 17:55:34 +02:00
|
|
|
};
|
|
|
|
}
|