tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
lightningstream: init at 0.4.3
Sam Willcocks
11 months ago
6e23095d
51037fd4
+69
1 changed file
expand all
collapse all
unified
split
pkgs
by-name
li
lightningstream
package.nix
+69
pkgs/by-name/li/lightningstream/package.nix
···
1
1
+
{
2
2
+
lib,
3
3
+
stdenv,
4
4
+
buildGoModule,
5
5
+
fetchFromGitHub,
6
6
+
installShellFiles,
7
7
+
versionCheckHook,
8
8
+
nix-update-script,
9
9
+
}:
10
10
+
let
11
11
+
version = "0.4.3";
12
12
+
in
13
13
+
buildGoModule {
14
14
+
pname = "lightningstream";
15
15
+
inherit version;
16
16
+
17
17
+
src = fetchFromGitHub {
18
18
+
owner = "PowerDNS";
19
19
+
repo = "lightningstream";
20
20
+
tag = "v${version}";
21
21
+
hash = "sha256-gnLmqm35HHpQlglKjw57NBMs8jMAHDieWlnE3OAQR4I=";
22
22
+
};
23
23
+
24
24
+
ldflags = [
25
25
+
"-s"
26
26
+
"-w"
27
27
+
"-X main.version=${version}"
28
28
+
];
29
29
+
30
30
+
vendorHash = "sha256-wkLoaR46l+jCm3TJDflcuI2hDvluoH2o5lLIqtrVRqo=";
31
31
+
32
32
+
nativeBuildInputs = [ installShellFiles ];
33
33
+
34
34
+
# Install shell completions so long as we can run the binary to do so. This means that
35
35
+
# when cross compiling we may not be able to generate shell completions.
36
36
+
# See https://github.com/NixOS/nixpkgs/issues/308283
37
37
+
#
38
38
+
# Dummy config file is currently required to generate completions. This may be fixed
39
39
+
# upstream; see https://github.com/PowerDNS/lightningstream/issues/85
40
40
+
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
41
41
+
cat <<END > lightningstream.yaml
42
42
+
lmdbs:
43
43
+
dummy:
44
44
+
path: dummy
45
45
+
END
46
46
+
47
47
+
installShellCompletion \
48
48
+
--cmd lightningstream \
49
49
+
--bash <($out/bin/lightningstream completion bash) \
50
50
+
--fish <($out/bin/lightningstream completion fish) \
51
51
+
--zsh <($out/bin/lightningstream completion zsh)
52
52
+
'';
53
53
+
54
54
+
nativeInstallCheckInputs = [ versionCheckHook ];
55
55
+
doInstallCheck = true;
56
56
+
versionCheckProgramArg = "--version";
57
57
+
58
58
+
passthru = {
59
59
+
updateScript = nix-update-script { };
60
60
+
};
61
61
+
62
62
+
meta = {
63
63
+
description = "LMDB sync via S3 buckets";
64
64
+
mainProgram = "lightningstream";
65
65
+
license = lib.licenses.mit;
66
66
+
homepage = "https://doc.powerdns.com/lightningstream/latest/index.html";
67
67
+
maintainers = with lib.maintainers; [ samw ];
68
68
+
};
69
69
+
}