From 580ecfe50147c3683f2aa4d45d09a9e9f706d774 Mon Sep 17 00:00:00 2001 From: jeirmeister Date: Tue, 29 Oct 2024 23:20:34 -0700 Subject: [PATCH] refactored for correct repo2text python package --- .-dump.txt | 22 +++++++++---------- home.nix | 2 +- users/jeirmeister/packages/repo2text.nix | 27 ++++++++++++++++++++++++ users/jeirmeister/packages/repo2txt.nix | 24 --------------------- users/jeirmeister/programs/gpg.nix | 2 +- 5 files changed, 40 insertions(+), 37 deletions(-) create mode 100644 users/jeirmeister/packages/repo2text.nix delete mode 100644 users/jeirmeister/packages/repo2txt.nix diff --git a/.-dump.txt b/.-dump.txt index 8d452f4..88d658c 100644 --- a/.-dump.txt +++ b/.-dump.txt @@ -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 = []; }; diff --git a/home.nix b/home.nix index 9f217cd..19225ff 100644 --- a/home.nix +++ b/home.nix @@ -26,7 +26,7 @@ in bitwarden-cli immersed nix-prefetch-git - customPackages.repo2txt + customPackages.repo2text # Development tools nodejs yarn diff --git a/users/jeirmeister/packages/repo2text.nix b/users/jeirmeister/packages/repo2text.nix new file mode 100644 index 0000000..9a3764a --- /dev/null +++ b/users/jeirmeister/packages/repo2text.nix @@ -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 = []; + }; +} \ No newline at end of file diff --git a/users/jeirmeister/packages/repo2txt.nix b/users/jeirmeister/packages/repo2txt.nix deleted file mode 100644 index d406ad4..0000000 --- a/users/jeirmeister/packages/repo2txt.nix +++ /dev/null @@ -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; - }; -} \ No newline at end of file diff --git a/users/jeirmeister/programs/gpg.nix b/users/jeirmeister/programs/gpg.nix index 73a8604..cd1f4d1 100644 --- a/users/jeirmeister/programs/gpg.nix +++ b/users/jeirmeister/programs/gpg.nix @@ -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