Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ snapshot_report.html
# Virtual environments
.venv
venv_fix/
result
result-*
22 changes: 22 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,28 @@ yay -S torrra-bin

> `torrra-bin` includes a precompiled standalone binary specifically for x86_64 Linux systems.

## Nix / NixOS

`torrra` is available on Nix and NixOS through a Nix flake.

### Run directly without installing

```sh
nix run github:stabldev/torrra
```

### Or add to your NixOS configuration

```nix
# In flake.nix inputs:
torrra.url = "github:stabldev/torrra";

# In your NixOS configuration:
environment.systemPackages = [ inputs.torrra.packages.${pkgs.system}.default ];
```

> **Note:** This requires [Nix flakes](https://nixos.wiki/wiki/Flakes) to be enabled.

## Standalone Binaries (No Python Required)

You can download pre-built executables of `torrra` directly from the [GitHub Releases](https://github.com/stabldev/torrra/releases) page. These binaries do not require Python to be installed on your system.
Expand Down
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
description = "Nix flake for torrra - Search and download torrents from the CLI";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

outputs = { self, nixpkgs }:
let
version = "2.0.7";
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSystem = f: nixpkgs.lib.genAttrs systems (system:
f nixpkgs.legacyPackages.${system}
);
in
{
packages = forEachSystem (pkgs: rec {
torrra = pkgs.callPackage ./package.nix { src = self; inherit version; };
default = torrra;
});

overlays.default = final: _prev: {
torrra = final.callPackage ./package.nix { src = self; inherit version; };
};

nixosModules.default = { lib, pkgs, config, ... }: {
options.programs.torrra.enable = lib.mkEnableOption "torrra torrent CLI";

config = lib.mkIf config.programs.torrra.enable {
nixpkgs.overlays = [ self.overlays.default ];
environment.systemPackages = [ pkgs.torrra ];
};
};
};
}
42 changes: 42 additions & 0 deletions package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{ lib
, python3Packages
, src
, version
}:

python3Packages.buildPythonApplication {
pname = "torrra";
inherit version src;

pyproject = true;

build-system = with python3Packages; [ hatchling ];

nativeBuildInputs = with python3Packages; [ pythonRelaxDepsHook ];

# pyproject.toml lists "libtorrent" (provided by nixpkgs as libtorrent-rasterbar,
# different name) and "libtorrent-windows-dll" (Windows-only, irrelevant here).
# Remove both so the runtime deps check doesn't fail;
# libtorrent-rasterbar is still injected via dependencies below.
pythonRemoveDeps = [ "libtorrent" "libtorrent-windows-dll" ];

dependencies = with python3Packages; [
libtorrent-rasterbar
textual
httpx
click
diskcache
platformdirs
tomli-w
];

pythonImportsCheck = [ "torrra" ];

meta = {
description = "Search and download torrents from the CLI, powered by Jackett/Prowlarr and Libtorrent";
homepage = "https://github.com/stabldev/torrra";
license = lib.licenses.mit;
mainProgram = "torrra";
platforms = lib.platforms.unix;
};
}