migrated tasks and downloads to this flake

This commit is contained in:
2024-12-14 14:08:50 -06:00
parent b33b69a698
commit c12e26ae7d
18 changed files with 953 additions and 25 deletions

37
pkgs/download.nix Normal file
View File

@@ -0,0 +1,37 @@
{
python3Packages,
gallery-dl,
ffmpeg,
callPackage,
...
}:
let
pname = "download";
version = "2.5";
in
python3Packages.buildPythonApplication {
inherit pname version;
src = builtins.path {
path = ../src/download/.;
name = "${pname}-${version}";
};
pyproject = true;
build-system = [ python3Packages.setuptools ];
dependencies =
[
ffmpeg
gallery-dl
(callPackage ./webcomix.nix { })
]
++ builtins.attrValues {
inherit (python3Packages)
pyyaml
types-pyyaml
yt-dlp
;
};
}

53
pkgs/webcomix.nix Normal file
View File

@@ -0,0 +1,53 @@
{
lib,
fetchFromGitHub,
python3Packages,
}:
python3Packages.buildPythonApplication rec {
pname = "webcomix";
version = "3.11.0";
pyproject = true;
src = fetchFromGitHub {
owner = "J-CPelletier";
repo = "webcomix";
rev = version;
hash = "sha256-Y16+/9TnECMkppgI/BeAbTLWt0M4V/xn1+hM4ILp/+g=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "poetry>=1.2.0" poetry-core \
--replace-fail "poetry.masonry.api" "poetry.core.masonry.api" \
--replace-fail 'pytest-rerunfailures = "^11.1.2"' 'pytest-rerunfailures = "14.0"'
'';
build-system = [
python3Packages.poetry-core
];
dependencies = with python3Packages; [
click
tqdm
scrapy
scrapy-splash
scrapy-fake-useragent
pytest-rerunfailures
docker
];
preCheck = ''
export HOME=$(mktemp -d)
'';
doCheck = false;
meta = {
description = "Webcomic downloader";
homepage = "https://github.com/J-CPelletier/webcomix";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ CaptainJawZ ];
mainProgram = "webcomix";
};
}