anime-downloader: add module

This commit is contained in:
Aguirre Matteo 2025-10-10 15:24:21 -03:00 committed by Austin Horstman
parent 4889a25756
commit 95419fb985
4 changed files with 142 additions and 0 deletions

View file

@ -0,0 +1,20 @@
{
"dl": {
"aria2c_for_torrents": false,
"chunk_size": "10",
"download_dir": ".",
"external_downloader": "{aria2}",
"fallback_qualities": [
"720p",
"480p",
"360p"
],
"file_format": "{anime_title}/{anime_title}_{ep_no}",
"force_download": false,
"player": null,
"provider": "twist.moe",
"quality": "1080p",
"skip_download": false,
"url": false
}
}

View file

@ -0,0 +1,5 @@
{ lib, pkgs, ... }:
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
anime-downloader-settings = ./settings.nix;
}

View file

@ -0,0 +1,46 @@
{
lib,
pkgs,
config,
...
}:
{
programs.anime-downloader = {
enable = true;
settings = {
dl = {
aria2c_for_torrents = false;
chunk_size = "10";
download_dir = ".";
external_downloader = "{aria2}";
fallback_qualities = [
"720p"
"480p"
"360p"
];
file_format = "{anime_title}/{anime_title}_{ep_no}";
force_download = false;
player = null;
provider = "twist.moe";
quality = "1080p";
skip_download = false;
url = false;
};
};
};
nmt.script =
let
configDir =
if pkgs.stdenv.hostPlatform.isDarwin then
"Library/Application Support/anime downloader"
else
"${lib.removePrefix config.home.homeDirectory config.xdg.configHome}/anime-downloader";
in
''
assertFileExists "home-files/${configDir}/config.json"
assertFileContent "home-files/${configDir}/config.json" \
${./config.json}
'';
}