refactored for correct repo2text python package

This commit is contained in:
jeirmeister 2024-10-29 23:20:34 -07:00
parent ed7a59b56d
commit 580ecfe501
5 changed files with 40 additions and 37 deletions

View File

@ -11,7 +11,7 @@
└── jeirmeister
├── packages
│ ├── default.nix
│ └── repo2txt.nix
│ └── repo2text.nix
└── programs
├── appimage.nix
├── default.nix
@ -58,7 +58,7 @@ in
bitwarden-cli
immersed
nix-prefetch-git
customPackages.repo2txt
customPackages.repo2text
];
};
@ -324,14 +324,14 @@ in
{ pkgs }:
{
repo2txt = pkgs.callPackage ./repo2txt.nix {};
repo2text = pkgs.callPackage ./repo2text.nix {};
}
--- Path: ./users/jeirmeister/packages/repo2txt.nix ---
--- Path: ./users/jeirmeister/packages/repo2text.nix ---
# users/jeirmeister/packages/repo2txt.nix
# users/jeirmeister/packages/repo2text.nix
{ pkgs }:
let
@ -340,12 +340,12 @@ let
]);
in
pkgs.stdenv.mkDerivation {
pname = "repo2txt";
pname = "repo2text";
version = "0.1.0";
src = pkgs.fetchFromGitHub {
owner = "pde-rent";
repo = "repo2txt";
repo = "repo2text";
rev = "2024b0eebebf739136401dc2f2df096be828558c";
hash = "sha256-80T28lXkk8hl/chzIy3Wvs1Jbs/rspxlnvWKa2DwJnU=";
};
@ -354,15 +354,15 @@ pkgs.stdenv.mkDerivation {
installPhase = ''
mkdir -p $out/bin
cp main.py $out/bin/repo2txt
chmod +x $out/bin/repo2txt
cp main.py $out/bin/repo2text
chmod +x $out/bin/repo2text
# Ensure it uses python interpreter
sed -i "1i#!${pythonEnv}/bin/python" $out/bin/repo2txt
sed -i "1i#!${pythonEnv}/bin/python" $out/bin/repo2text
'';
meta = with pkgs.lib; {
description = "Tool to dump a repository into a single text file";
homepage = "https://github.com/pde-rent/repo2txt";
homepage = "https://github.com/pde-rent/repo2text";
license = licenses.mit;
maintainers = [];
};

View File

@ -26,7 +26,7 @@ in
bitwarden-cli
immersed
nix-prefetch-git
customPackages.repo2txt
customPackages.repo2text
# Development tools
nodejs
yarn

View File

@ -0,0 +1,27 @@
# users/jeirmeister/packages/repo2text.nix
{ pkgs }:
pkgs.python3Packages.buildPythonPackage rec {
pname = "repo2text";
version = "0.1.5"; # Check PyPI for the latest version
format = "setuptools";
src = pkgs.fetchPypi {
inherit pname version;
sha256 = "8c1e338c32154b118fc9eaa686fcdb024eb075b05ce32f7fcba51cde0a57bf26"; # You might need to update this
};
propagatedBuildInputs = with pkgs.python3Packages; [
gitpython # Required dependency
];
# Add some basic tests
pythonImportsCheck = [ "repo2text" ];
meta = with pkgs.lib; {
description = "Convert code repositories into text format for LLM processing";
homepage = "https://pypi.org/project/repo2text/";
license = licenses.mit;
maintainers = [];
};
}

View File

@ -1,24 +0,0 @@
# users/jeirmeister/packages/repo2txt.nix
{ pkgs }:
pkgs.python3Packages.buildPythonPackage rec {
pname = "repo2txt";
version = "1.0.3"; # Check PyPI for latest version
format = "pyproject";
src = pkgs.python3Packages.fetchPypi {
inherit pname version;
hash = "sha256-t62YxDNb7xWCpR70QeVHjkWLAXZ2bHxiPtYbz2jnSjE="; # You might need to update this
};
# Add any runtime dependencies if needed in the future
propagatedBuildInputs = with pkgs.python3Packages; [ ];
pythonImportsCheck = [ "repo2txt" ];
meta = with pkgs.lib; {
description = "Tool to dump repository contents into a single text file";
homepage = "https://pypi.org/project/repo2txt/";
license = licenses.mit;
};
}

View File

@ -34,7 +34,7 @@
defaultCacheTtl = 1800;
maxCacheTtl = 7200;
# For KDE/Plasma, use pinentry-qt
pinentryPackage = "qt";
pinentryPackage = pkgs.pinentry-qt;
extraConfig = ''
allow-preset-passphrase
allow-loopback-pinentry