diff options
| author | Akshay Nair <phenax5@gmail.com> | 2026-03-22 12:34:22 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2026-03-22 12:34:22 +0530 |
| commit | 4dfd12cac4b15fa58c678af269e465bee0edb23b (patch) | |
| tree | c079ac82768691760e20205c2cafe5a171ed2150 | |
| parent | cef61e5b571bdba43d8b81c253be505c897f4c4b (diff) | |
| download | homeserver-nixos-config-4dfd12cac4b15fa58c678af269e465bee0edb23b.tar.gz homeserver-nixos-config-4dfd12cac4b15fa58c678af269e465bee0edb23b.zip | |
Add kavita for books
| -rw-r--r-- | README.md | 3 | ||||
| -rw-r--r-- | modules/dashboard/default.nix | 1 | ||||
| -rw-r--r-- | modules/dashboard/links.nix | 14 | ||||
| -rw-r--r-- | modules/media/books.nix | 38 | ||||
| -rw-r--r-- | modules/media/servarr.nix | 9 | ||||
| -rw-r--r-- | modules/network/default.nix | 3 | ||||
| -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 | ||||
| -rw-r--r-- | settings.nix | 5 |
10 files changed, 14 insertions, 266 deletions
@@ -10,7 +10,8 @@ Services: - send - syncthing - coredns -- grafana +- kavita +- omnisearch - other stuff  diff --git a/modules/dashboard/default.nix b/modules/dashboard/default.nix index 4dd3ef0..8e141ed 100644 --- a/modules/dashboard/default.nix +++ b/modules/dashboard/default.nix @@ -18,7 +18,6 @@ in openFirewall = true; port = settings.network.ports.dashboard; title = "Bacchus Dashboard"; - # embedLink = settings.grafana.dashboardEmbedLink; links = links; }; } diff --git a/modules/dashboard/links.nix b/modules/dashboard/links.nix index 0232a7f..df130a4 100644 --- a/modules/dashboard/links.nix +++ b/modules/dashboard/links.nix @@ -59,13 +59,6 @@ in [ altUrl = "http://${host}:${toString ports.ntfy}"; color = "#2dc9b5"; } - # { - # title = "Grafana"; - # key = "g"; - # url = "http://grafana.local"; - # altUrl = "http://${host}:${toString ports.grafana}"; - # color = "#f05a28"; - # } { title = "Send"; key = "f"; @@ -80,11 +73,4 @@ in [ altUrl = "http://${host}:${toString ports.yarr}"; color = "#475569"; } - # { - # title = "Lazy Librarian"; - # key = "b"; - # url = "http://librarian.local"; - # altUrl = "http://${host}:${toString ports.lazylibrarian}"; - # color = "#55a4db"; - # } ] diff --git a/modules/media/books.nix b/modules/media/books.nix index 3fb2cb5..92af758 100644 --- a/modules/media/books.nix +++ b/modules/media/books.nix @@ -1,32 +1,14 @@ { settings, pkgs, ... }: { - imports = [ - # ../../services/lazylibrarian/default.nix - ]; + # NOTE: Run `head -c 64 /dev/urandom | base64 --wrap=0 > /var/lib/kavita-token` + services.kavita = { + enable = true; + tokenKeyFile = "/var/lib/kavita-token"; + user = "kavita"; # TODO: fix permissions + settings = { + Port = settings.network.ports.library; + }; + }; - # systemd.tmpfiles.rules = [ - # "d ${settings.media.booksDir} 0770 - ${settings.media.group} - -" - # ]; - - # services.lazylibrarian = { - # enable = true; - # }; - - # virtualisation.oci-containers.containers.lazy-librarian = { - # image = "linuxserver/lazylibrarian"; - # # user = "lazylibrarian:${settings.media.group}"; - # imageFile = pkgs.dockerTools.pullImage { - # imageName = "linuxserver/lazylibrarian"; - # finalImageTag = "version-68d7f93c"; - # imageDigest = "sha256:5d0c935283e5393ff57fb52e88660ccc596c170cc6f68c58045cd2c792108fdd"; - # sha256 = "sha256-jpdOJhf02Nbw/yRjEzTw+unZb7Ou+Lh9kPB/0oqHYV4="; - # }; - # extraOptions = ["--network=host"]; - # ports = ["${toString settings.network.ports.lazylibrarian}:5299"]; - # volumes = [ - # "${settings.media.booksDir}:/books" - # "${settings.media.downloadsDir}:/downloads" - # "/var/lib/lazylibrarian:/config" - # ]; - # }; + networking.firewall.allowedTCPPorts = [settings.network.ports.library]; } diff --git a/modules/media/servarr.nix b/modules/media/servarr.nix index 2e6c273..fa705d1 100644 --- a/modules/media/servarr.nix +++ b/modules/media/servarr.nix @@ -26,15 +26,6 @@ }; }; - # services.lidarr = { - # enable = true; - # openFirewall = true; - # group = settings.media.group; - # settings = { - # server.port = settings.network.ports.lidarr; - # }; - # }; - services.prowlarr = { enable = true; openFirewall = true; diff --git a/modules/network/default.nix b/modules/network/default.nix index de349e6..0234686 100644 --- a/modules/network/default.nix +++ b/modules/network/default.nix @@ -29,14 +29,13 @@ in "syncthing.local" = { inherit host; port = ports.syncthing; }; # "lidarr.local" = { inherit host; port = ports.lidarr; }; "ntfy.local" = { inherit host; port = ports.ntfy; }; - "grafana.local" = { inherit host; port = ports.grafana; extraNginxOptions.recommendedProxySettings = true; }; "send.local" = { inherit host; port = ports.send; }; "photos.local" = { inherit host; port = ports.immich; }; "news.local" = { inherit host; port = ports.yarr; }; - # "librarian.local" = { inherit host; port = ports.lazylibrarian; }; "paperless.local" = { inherit host; port = ports.paperless; configureNginx = true; }; "calendar.local" = { inherit host; port = ports.caldav; }; "search.local" = { inherit host; port = ports.search; }; + "library.local" = { inherit host; port = ports.library; }; }; }; 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"; - }; -} diff --git a/settings.nix b/settings.nix index 57c23c0..e599966 100644 --- a/settings.nix +++ b/settings.nix @@ -15,13 +15,10 @@ in lib.recursiveUpdate privateSettings rec { transmissionRPC = 9091; syncthing = 3141; ntfy = 3142; - grafana = 3143; - prometheus = 9001; - prometheusNodeExporter = 9002; send = 1443; immich = 3144; yarr = 7070; - lazylibrarian = 5299; + library = 5299; paperless = 28981; caldav = 9314; search = 8087; |
