-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpackage.nix
More file actions
67 lines (58 loc) · 1.5 KB
/
package.nix
File metadata and controls
67 lines (58 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
lib,
stdenv,
buildGo125Module,
fetchFromGitHub,
installShellFiles,
src ? null,
}: let
version =
if src != null
then "unstable"
else "0.3.0";
in
buildGo125Module {
pname = "tpm-trust";
inherit version;
src =
if src != null
then src
else
fetchFromGitHub {
owner = "loicsikidi";
repo = "tpm-trust";
tag = "v${version}";
hash = "sha256-fU7gUspZaDxfyQblQzmOdyk1FyGP7TbKFXu9riTnyr8=";
};
vendorHash = "sha256-jkZ9J97giFaaoK+sSFCHyV55bqCzaAYqu5A03sWppOg=";
# Build the main package (at the root)
# subPackages defaults to [ "." ] if not specified
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
"-X main.builtBy=nix"
];
doCheck = true;
checkFlags = [
"-v"
"-timeout=30s"
];
nativeBuildInputs = [installShellFiles];
postInstall =
lib.optionalString
(stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
# Generate shell completions
installShellCompletion --cmd tpm-trust \
--bash <($out/bin/tpm-trust completion bash) \
--zsh <($out/bin/tpm-trust completion zsh) \
--fish <($out/bin/tpm-trust completion fish)
'';
meta = {
description = "TPM Trust Bundle - manages TPM root certificates bundle";
homepage = "https://github.com/loicsikidi/tpm-trust";
license = lib.licenses.bsd3;
maintainers = [];
mainProgram = "tpm-trust";
};
}