From e062ca72b222b890e345548bd8422d5df98e9fef Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 9 May 2024 16:47:41 +0200 Subject: feat: import sources from configuration in go code and index options --- nix/overlays/bleve.nix | 39 +++++++++++++++++++++++++++++++++++++++ nix/overlays/default.nix | 1 + 2 files changed, 40 insertions(+) create mode 100644 nix/overlays/bleve.nix (limited to 'nix/overlays') diff --git a/nix/overlays/bleve.nix b/nix/overlays/bleve.nix new file mode 100644 index 0000000..8e36679 --- /dev/null +++ b/nix/overlays/bleve.nix @@ -0,0 +1,39 @@ +{ lib +, stdenv +, fetchFromGitHub +, installShellFiles +, buildGoModule +}: +let + gomod = builtins.fromTOML (builtins.readFile ./../../gomod2nix.toml); + version = gomod.mod."github.com/blevesearch/bleve/v2".version; +in +buildGoModule rec { + pname = "bleve"; + inherit version; + + src = fetchFromGitHub { + owner = "blevesearch"; + repo = "bleve"; + rev = version; + hash = "sha256-E7ykT0t4QTn615WfTE9EygD+p5kQQ3Qm7zZ/Jqb8tK8="; + }; + + vendorHash = "sha256-gkajiRCY+tPifBz5PRelFCZCfaWN/pti+7amuRmQI6Q="; + + subPackages = [ "cmd/bleve" ]; + + nativeBuildInputs = [ installShellFiles ]; + postInstall = lib.optionalString (stdenv.buildPlatform == stdenv.targetPlatform) '' + installShellCompletion --cmd bleve \ + --bash <($out/bin/bleve completion bash) \ + --fish <($out/bin/bleve completion fish) \ + --zsh <($out/bin/bleve completion zsh) + ''; + + meta = { + description = "Command-line tool to interact with bleve indexes"; + homepage = "http://blevesearch.com"; + licenses = lib.licenses.asl20; + }; +} diff --git a/nix/overlays/default.nix b/nix/overlays/default.nix index 3e5c925..db27c7e 100644 --- a/nix/overlays/default.nix +++ b/nix/overlays/default.nix @@ -3,4 +3,5 @@ self: super: { (final: prev: super.callPackage ./prettier-plugin-go-template { } ); + bleve = super.callPackage ./bleve.nix { }; } -- cgit 1.4.1