diff options
Diffstat (limited to 'services/lazylibrarian')
| -rw-r--r-- | services/lazylibrarian/default.nix | 32 | ||||
| -rw-r--r-- | services/lazylibrarian/fix-setup.diff | 40 | ||||
| -rw-r--r-- | services/lazylibrarian/package.nix | 135 |
3 files changed, 0 insertions, 207 deletions
diff --git a/services/lazylibrarian/default.nix b/services/lazylibrarian/default.nix deleted file mode 100644 index 4514713..0000000 --- a/services/lazylibrarian/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ config, pkgs, lib, ... }: -with lib; -let - lazylibrarian = pkgs.callPackage ./package.nix {}; - cfg = config.services.lazylibrarian; -in -{ - options.services.lazylibrarian = { - enable = mkEnableOption "lazy librarian"; - # port = mkOption { type = types.int; default = 53; }; - # hosts = mkOption { type = types.attrsOf types.str; default = {}; }; - }; - - environment.systemPackages = [lazylibrarian]; - - config.systemd.services.lazylibrarian = mkIf cfg.enable { - description = "Lazylibrarian"; - after = [ "network.service" ]; - wantedBy = [ "multi-user.target" ]; - - serviceConfig = { - ExecStart = "${lazylibrarian}/bin/lazylibrarian"; - Restart = "on-failure"; - RestartSec = 3; - TimeoutSec = "5min"; - IgnoreSIGPIPE = "no"; - KillMode = "process"; - GuessMainPID = "no"; - RemainAfterExit = "yes"; - }; - }; -} diff --git a/services/lazylibrarian/fix-setup.diff b/services/lazylibrarian/fix-setup.diff deleted file mode 100644 index d86a2d7..0000000 --- a/services/lazylibrarian/fix-setup.diff +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/MANIFEST.in b/MANIFEST.in -new file mode 100644 -index 00000000..bec3e4d2 ---- /dev/null -+++ b/MANIFEST.in -@@ -0,0 +1 @@ -+recursive-include src/data * -diff --git a/pyproject.toml b/pyproject.toml -index b415e8cb..252f761e 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -2,9 +2,6 @@ - requires = ["setuptools", "ez_setup"] - build-backend = "setuptools.build_meta" - --[tool.setuptools.packages.find] --where = ["lazylibrarian"] -- - [project] - name = "LazyLibrarian" - version = "2025.01.09" -@@ -16,7 +13,7 @@ classifiers = [ - ] - - dependencies = [ -- 'bs4', -+ 'beautifulsoup4', - 'html5lib', - 'webencodings', - 'requests[use_chardet_on_py3]', -@@ -44,6 +41,9 @@ dependencies = [ - "Documentation" = "https://lazylibrarian.gitlab.io/" - "Issue Tracker" = "https://gitlab.com/LazyLibrarian/LazyLibrarian/-/issues" - -+[project.scripts] -+lazylibrarian = "LazyLibrarian:main" -+ - # Config file for pytest - [tool.pytest.ini_options] - pythonpath = "." diff --git a/services/lazylibrarian/package.nix b/services/lazylibrarian/package.nix deleted file mode 100644 index 0df6845..0000000 --- a/services/lazylibrarian/package.nix +++ /dev/null @@ -1,135 +0,0 @@ -# https://github.com/NixOS/nixpkgs/pull/423722/files -{ - calibre, - fetchFromGitLab, - fetchPypi, - ffmpeg-headless, - lib, - nix-update-script, - python3Packages, - calibreSupport ? true, - ffmpegSupport ? true, -}: -let - ez_setup = python3Packages.buildPythonPackage rec { - pname = "ez_setup"; - version = "0.9"; - pyproject = true; - - src = fetchPypi { - inherit pname version; - hash = "sha256-MDxbF9VS0eP7BQXYBUn4V59VfhPY3JDl7O88B9f1hkI="; - }; - - build-system = with python3Packages; [ - distutils - setuptools - wheel - ]; - - pythonImportsCheck = [ - "ez_setup" - ]; - }; - - slskd-api = python3Packages.buildPythonPackage rec { - pname = "slskd-api"; - version = "0.1.5"; - pyproject = true; - - src = fetchPypi { - inherit pname version; - hash = "sha256-LmWP7bnK5IVid255qS2NGOmyKzGpUl3xsO5vi5uJI88="; - }; - - build-system = with python3Packages; [ - setuptools - setuptools-git-versioning - wheel - ]; - - dependencies = with python3Packages; [ - requests - ]; - - pythonImportsCheck = [ - "slskd_api" - ]; - }; -in -python3Packages.buildPythonApplication rec { - pname = "lazylibrarian"; - version = "2025.01.09-unstable-2025-07-08"; - pyproject = true; - - src = fetchFromGitLab { - owner = "LazyLibrarian"; - repo = "LazyLibrarian"; - rev = "d88acba6332ebcc517b1d071a27a0b5afe522c0f"; - hash = "sha256-HMoV9pLCdgppmSHJfJcpEWiogTJys1qIjeHvXpT+3fo="; - }; - - patches = [ - ./fix-setup.diff - ]; - - postPatch = '' - mkdir -p src - mv LazyLibrarian.py lazylibrarian lib data src - ''; - - build-system = with python3Packages; [ - ez_setup - setuptools - ]; - - dependencies = - with python3Packages; - [ - apprise - apscheduler - beautifulsoup4 - cherrypy - cherrypy-cors - deluge-client - html5lib - httpagentparser - httplib2 - irc - mako - pillow - pyopenssl - pyparsing - pypdf - python-magic - rapidfuzz - requests - tzdata - urllib3 - webencodings - ] - ++ [ slskd-api ] - ++ lib.optional calibreSupport [ calibre ] - ++ lib.optional ffmpegSupport [ ffmpeg-headless ]; - - pythonImportsCheck = [ - "lazylibrarian" - ]; - - makeWrapperArgs = [ - # Avoid automatic updates. - "--set DOCKER 1" - # Avoid `datadir` being on `/nix/store` by default. - "--add-flags --datadir=\\$XDG_DATA_HOME/${meta.mainProgram}" - ]; - - passthru.updateScript = nix-update-script { }; - - meta = { - description = "Usenet/BitTorrent ebook, audiobook and magazine downloader"; - homepage = "https://lazylibrarian.gitlab.io/"; - license = lib.licenses.gpl3Only; - maintainers = with lib.maintainers; [ xelden ]; - mainProgram = "lazylibrarian"; - }; -} |
