nixpkgs/pkgs/by-name/sb/sbctl/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
1.7 KiB
Nix
Raw Normal View History

{
lib,
buildGoModule,
stdenv,
fetchFromGitHub,
installShellFiles,
asciidoc,
databasePath ? "/etc/secureboot",
nix-update-script,
2022-08-21 17:55:34 +02:00
}:
buildGoModule rec {
pname = "sbctl";
version = "0.17";
2022-08-21 17:55:34 +02:00
src = fetchFromGitHub {
owner = "Foxboron";
repo = "sbctl";
tag = version;
hash = "sha256-7dCaWemkus2GHxILBEx5YvzdAmv89JfcPbqZZ6QwriI";
2022-08-21 17:55:34 +02:00
};
vendorHash = "sha256-gpHEJIbLnB0OiYB00rHK6OwrnHTHCj/tTVlUzuFjFKY=";
2022-08-21 17:55:34 +02: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
nativeBuildInputs = [
installShellFiles
asciidoc
];
2022-08-21 17:55:34 +02:00
postBuild = ''
make docs/sbctl.conf.5 docs/sbctl.8
2022-08-21 17:55:34 +02:00
'';
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)
'';
2022-08-21 17:55:34 +02:00
passthru.updateScript = nix-update-script { };
meta = {
2022-08-21 17:55:34 +02:00
description = "Secure Boot key manager";
mainProgram = "sbctl";
2022-08-21 17:55:34 +02:00
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;
2022-08-21 17:55:34 +02:00
};
}