lightningstream: init at 0.4.3

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