diff --git a/hosts/kuro/default.nix b/hosts/kuro/default.nix index ed972261..9c6507ec 100644 --- a/hosts/kuro/default.nix +++ b/hosts/kuro/default.nix @@ -47,6 +47,7 @@ vim.enable = true; }; shell = { + adl.enable = true; bitwarden.enable = true; direnv.enable = true; git.enable = true; diff --git a/hosts/shiro/default.nix b/hosts/shiro/default.nix index 687353d1..8c97afe5 100644 --- a/hosts/shiro/default.nix +++ b/hosts/shiro/default.nix @@ -41,6 +41,7 @@ }; dev = {}; shell = { + adl.enable = true; bitwarden.enable = true; direnv.enable = true; git.enable = true; diff --git a/modules/shell/adl.nix b/modules/shell/adl.nix new file mode 100644 index 00000000..ddd97924 --- /dev/null +++ b/modules/shell/adl.nix @@ -0,0 +1,27 @@ +# modules/shell/adl.nix +# +# To maintain my filty weeb habits, I need tools. Tools that make it easy to +# watch animu and track 'em on anilist. Laziness > my weebery. + +{ options, config, lib, pkgs, ... }: + +with lib; +with lib.my; +let cfg = config.modules.shell.adl; +in { + options.modules.shell.adl = { + enable = mkBoolOpt false; + }; + + config = mkIf cfg.enable { + user.packages = with pkgs; [ + # Dependencies + my.trackma + my.anime-downloader + mpv + + # The star of the show + my.adl + ]; + }; +} diff --git a/packages/adl.nix b/packages/adl.nix new file mode 100644 index 00000000..d5789c6f --- /dev/null +++ b/packages/adl.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchzip, my, ... }: + +stdenv.mkDerivation { + name = "adl"; + + src = fetchzip { + url = "https://github.com/RaitaroH/adl/archive/master.zip"; + sha256 = "HtKSPD3g0y68A37N4HhOIorW4sPyOr4ei9wABFh4GYc="; + }; + + buildInputs = with my; [ + trackma + anime-downloader + ]; + + phases = "installPhase"; + installPhase = '' + mkdir -p $out/bin + cp $src/adl $out/bin/adl + cp ${my.trackma}/bin/trackma $out/bin/trackma + cp ${my.anime-downloader}/bin/anime $out/bin/anime + ''; + + meta = { + homepage = "https://github.com/RaitaroH/adl"; + description = "popcorn anime-downloader + trackma wrapper"; + license = lib.licenses.gpl3; + platforms = [ "x86_64-linux" ]; + maintainers = []; + }; +} diff --git a/packages/anime-downloader.nix b/packages/anime-downloader.nix new file mode 100644 index 00000000..1d640d2a --- /dev/null +++ b/packages/anime-downloader.nix @@ -0,0 +1,58 @@ +{ lib, python3, nodejs, aria2, coloredlogs }: + +with python3.pkgs; +let + pySmartDL = buildPythonPackage rec { + pname = "pySmartDL"; + version = "1.3.4"; + src = fetchPypi { + inherit pname version; + sha256 = "NSddFpTzR00zvcqTsn02CCZf/UL1rrKOVvOLkGwMNfQ="; + }; + doCheck = false; + }; + cfscrape = buildPythonPackage rec { + pname = "cfscrape"; + version = "2.0.5"; + src = fetchPypi { + inherit pname version; + sha256 = "2VwWsGdxJ9+uPqUp82AdFHTK5+MlJ44dnYmipz7yH6k="; + }; + buildInputs = [ requests ]; + doCheck = false; + }; +in buildPythonApplication rec { + pname = "anime-downloader"; + version = "5.0.7"; + + src = fetchPypi { + inherit pname version; + sha256 = "BP4Wf2efU1RUk6I+82rFcvEdxDSKonTOIZjm3B0x7Eg="; + }; + + propagatedBuildInputs = [ + aria2 + nodejs + beautifulsoup4 + cfscrape + click + coloredlogs + fuzzywuzzy + pySmartDL + pycryptodome + requests + requests-cache + setuptools + tabulate + ]; + + doCheck = false; + + meta = { + homepage = "https://github.com/anime-dl/anime-downloader"; + description = "A simple but powerful anime downloader and streamer."; + license = lib.licenses.unlicense; + platforms = [ "x86_64-linux" ]; + maintainers = []; + }; +} diff --git a/packages/trackma.nix b/packages/trackma.nix new file mode 100644 index 00000000..f2f33bfe --- /dev/null +++ b/packages/trackma.nix @@ -0,0 +1,24 @@ +{ lib, python3 }: + +with python3.pkgs; +buildPythonApplication rec { + pname = "Trackma"; + version = "0.8.4"; + + src = fetchPypi { + inherit pname version; + sha256 = "9UHhxpbDcjW42JlefDHkTor1TdKmCQ1a1u0JS0Rt79k="; + }; + + # No tests included + doCheck = false; + pythonImportsCheck = [ "trackma" ]; + + meta = with lib; { + homepage = "https://github.com/z411/trackma"; + description = "Open multi-site list manager for Unix-like systems. (ex-wMAL)"; + license = licenses.gpl3; + platforms = [ "x86_64-linux" ]; + maintainers = []; + }; +}