No description
  • Nix 79.5%
  • Shell 20.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-06 01:29:27 +01:00
nix update 2026-11-06 01:29:27 +01:00
.gitignore init 2026-10-06 11:18:24 +02:00
0001-crypto-internal-fips140-sha256-add-SHA-NI-implementa.patch update 2026-10-06 16:47:17 +02:00
0001-crypto-sha1-add-SHA-NI-implementation-without-AVX.patch update 2026-10-06 16:47:17 +02:00
binaries.json update 2026-11-06 01:29:27 +01:00
flake.lock update flake inputs 2026-10-11 20:58:50 +02:00
flake.nix init 2026-10-06 11:18:24 +02:00
mkbrr.patch update 2026-10-06 16:47:17 +02:00
README.md update 2026-10-06 12:13:33 +02:00
update.sh update 2026-11-06 01:29:27 +01:00
upstream.json update 2026-11-06 01:29:27 +01:00

Upload Assistant for Nix

Nix flake for Upload Assistant. It builds the upstream source with uv2nix from upstream's uv.lock, so the Python dependencies match upstream's pinned versions.

This is a modified version of the Upload Assistant project and is not affiliated with or endorsed by Audionut. The only modification makes it use Nix-built tools instead of downloading prebuilt binaries (see below).

Upload Assistant is distributed under the UAPL v1.0. Nix treats that license as unfree, but this flake allows it for its own package.

Usage

nix run github:<you>/<this-repo> -- --help

NixOS

{
  inputs.upload-assistant.url = "github:<you>/<this-repo>";

  outputs = { nixpkgs, upload-assistant, ... }: {
    nixosConfigurations.host = nixpkgs.lib.nixosSystem {
      modules = [
        upload-assistant.nixosModules.default
        {
          services.upload-assistant = {
            enable = true;
            host = "127.0.0.1";
            port = 5000;
            browseRoots = [ "/srv/torrents" ];
            extraGroups = [ "media" "qbittorrent" ];   # access via groups, own UID
            # configFile = "/run/secrets/ua-config.py"; # otherwise configure via the web UI
          };
        }
      ];
    };
  };
}

State (data/config.py, caches, the web UI session secret) lives in /var/lib/upload-assistant. On first start the config is created from upstream's example.

By default the service runs as its own upload-assistant user. Grant access to media and your torrent client's files through extraGroups, using group-owned directories with the setgid bit (e.g. mode 2770) so files it creates there stay readable by the other service.

External tools

Upstream downloads prebuilt binaries into its state directory. This package builds them from source instead, at the versions upstream pins, and makes them the defaults for the matching *_path settings (paths set in config.py still win):

Setting Tool
mediainfo_path MediaInfo (upstream's pinned version)
dvd_mediainfo_path the older MediaInfo upstream requires for DVDs (currently 23.04)
bdinfo_path go-bdinfo
mkbrr_path mkbrr
dovi_tool_path, hdr10plus_tool_path dovi_tool, hdr10plus_tool
ffmpeg_path, ffprobe_path ffmpeg-headless from nixpkgs

par2 and 7z (nixpkgs) are also on PATH for Usenet uploads. Nyuu and pesto are not packaged, so upstream still downloads those if you use Usenet uploads. The web UI's tool status shows DVD MediaInfo as "Check version", because upstream does not read the version of configured binaries.

Updating

nix run .#update                 # latest vX.Y release tag
nix run .#update -- development  # head of the development branch
nix run .#update -- <ref>        # any tag, branch or commit
nix flake check                  # builds the package and runs the NixOS VM test

The script

  1. resolves the ref and writes upstream.json (ref, version, rev, hash);
  2. reads the tool pins from that upstream revision (bin/binary_dependency_pins/*.py, bin/get_mediainfo.py, bin/get_dvd_mediainfo.py) and, for every tool whose version changed, writes the new version, source hash and Go/Cargo dependency hash to binaries.json. Dependency hashes are found by building with a fake hash.

Python dependencies come from the new revision's uv.lock, so they need no extra hashes. If upstream changes the code the binary patches target, the build fails (substituteInPlace --replace-fail in nix/package.nix) instead of silently downloading again.