diff --git a/pkgs/by-name/he/helix-db/disable-updates.patch b/pkgs/by-name/he/helix-db/disable-updates.patch new file mode 100644 index 000000000000..e4b26c3265d8 --- /dev/null +++ b/pkgs/by-name/he/helix-db/disable-updates.patch @@ -0,0 +1,36 @@ +diff --git a/helix-cli/src/main.rs b/helix-cli/src/main.rs +index 18e279fd..a3ec271c 100644 +--- a/helix-cli/src/main.rs ++++ b/helix-cli/src/main.rs +@@ -121,13 +121,6 @@ enum Commands { + action: MetricsAction, + }, + +- /// Update to the latest version +- Update { +- /// Force update even if already on latest version +- #[clap(long)] +- force: bool, +- }, +- + /// Migrate v1 project to v2 format + Migrate { + /// Project directory to migrate (defaults to current directory) +@@ -253,9 +246,6 @@ async fn main() -> Result<()> { + // Send CLI install event (only first time) + metrics_sender.send_cli_install_event_if_first_time(); + +- // Check for updates before processing commands +- update::check_for_updates().await?; +- + let cli = Cli::parse(); + + let result = match cli.command { +@@ -280,7 +270,6 @@ async fn main() -> Result<()> { + Commands::Prune { instance, all } => commands::prune::run(instance, all).await, + Commands::Delete { instance } => commands::delete::run(instance).await, + Commands::Metrics { action } => commands::metrics::run(action).await, +- Commands::Update { force } => commands::update::run(force).await, + Commands::Migrate { + path, + queries_dir, diff --git a/pkgs/by-name/he/helix-db/package.nix b/pkgs/by-name/he/helix-db/package.nix new file mode 100644 index 000000000000..30ad67eed5e4 --- /dev/null +++ b/pkgs/by-name/he/helix-db/package.nix @@ -0,0 +1,58 @@ +{ + lib, + stdenv, + rustPlatform, + fetchFromGitHub, + pkg-config, + openssl, + versionCheckHook, + nix-update-script, +}: +rustPlatform.buildRustPackage (finalAttrs: { + pname = "helix-db"; + version = "2.0.5"; + + src = fetchFromGitHub { + repo = "helix-db"; + owner = "HelixDB"; + tag = "v${finalAttrs.version}"; + hash = "sha256-lNAaOpF6g2yunGP9bgsMVvVc7YMfZ44WfkumR+8Btlg="; + }; + + cargoHash = "sha256-YCBTSm252eUJeOyMIEcZ+0AyHoYM1QceYSHhp+qwf6Q="; + + patches = [ + #There are no feature yet + ./disable-updates.patch + ]; + + nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; + + buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ openssl ]; + + env.OPENSSL_NO_VENDOR = true; + + cargoBuildFlags = [ + "-p" + "helix-cli" + ]; + + #There are no tests + doCheck = false; + + nativeInstallCheckInputs = [ versionCheckHook ]; + + doInstallCheck = true; + versionCheckProgramArg = "--version"; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Open-source graph-vector database built from scratch in Rust"; + homepage = "https://github.com/HelixDB/helix-db"; + changelog = "https://github.com/HelixDB/helix-db/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.agpl3Only; + maintainers = with lib.maintainers; [ nartsiss ]; + mainProgram = "helix"; + }; +})