From 6303ad72b5612e7b296307ddcb8aa139aa7c7b89 Mon Sep 17 00:00:00 2001 From: ob7 Date: Mon, 9 Dec 2024 03:16:32 -0900 Subject: [PATCH] tenere: init at 0.11.2-0f3181a Terminal interface for large language models (LLMs). Adds a new package that provides a TUI for interacting with LLM services like Ollama. https://github.com/pythops/tenere --- pkgs/by-name/te/tenere/package.nix | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 pkgs/by-name/te/tenere/package.nix diff --git a/pkgs/by-name/te/tenere/package.nix b/pkgs/by-name/te/tenere/package.nix new file mode 100644 index 00000000000000..a9dfc13abe4565 --- /dev/null +++ b/pkgs/by-name/te/tenere/package.nix @@ -0,0 +1,45 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, makeWrapper +}: +rustPlatform.buildRustPackage rec { + pname = "tenere"; + rev = "0f3181a"; + version = "0.11.2-${rev}"; + src = fetchFromGitHub { + owner = "pythops"; + repo = pname; + rev = "${rev}"; + hash = "sha256-HKPCX0bmXkB3LwvgE1li3dlWTgpW5CXuWZNq3mFY6FY="; + }; + cargoHash = "sha256-szYiPunSgnzSXkkYL2xPgieF2ArkTjDjCAfN8OGmZeQ="; + + nativeBuildInputs = [ makeWrapper ]; + + CARGO_PROFILE_RELEASE_LTO = "fat"; + CARGO_PROFILE_RELEASE_STRIP = "true"; + CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "1"; + postInstall = '' + wrapProgram $out/bin/tenere \ + --run ' + CONFIG_DIR="''${XDG_CONFIG_HOME:-$HOME/.config}/tenere" + DATA_DIR="''${XDG_DATA_HOME:-$HOME/.local/share}/tenere" + mkdir -p "$CONFIG_DIR" + mkdir -p "$DATA_DIR" + chown "$(id -u):$(id -g)" "$CONFIG_DIR" "$DATA_DIR" 2>/dev/null || true + chmod 755 "$CONFIG_DIR" "$DATA_DIR" + ' + ''; + + requiredSystemFeatures = [ "big-parallel" ]; # fat LTO requires ~3.4GB RAM + + meta = with lib; { + description = "Terminal interface for large language models (LLMs)"; + homepage = "https://github.com/pythops/tenere"; + platforms = platforms.linux; + license = licenses.gpl3; + maintainers = with maintainers; [ ob7 ]; + mainProgram = "tenere"; + }; +}