From f5d51dba7341eadf04749f6a9703f83a5cde4390 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 10 Nov 2025 12:22:55 +0530 Subject: Update + add books module disabled --- modules/config.nix | 5 +++++ modules/dashboard/links.nix | 21 ++++++++++++++------- modules/hardware/default.nix | 16 ++++++++-------- modules/hardware/fs.nix | 4 ++-- modules/media/books.nix | 24 ++++++++++++++++++++++++ modules/media/default.nix | 1 + modules/media/torrent.nix | 1 + modules/network/default.nix | 1 + modules/rss/feeds.nix | 3 +++ modules/storage/syncthing.nix | 5 +++++ 10 files changed, 64 insertions(+), 17 deletions(-) create mode 100644 modules/media/books.nix (limited to 'modules') diff --git a/modules/config.nix b/modules/config.nix index 2bd3267..54108fe 100644 --- a/modules/config.nix +++ b/modules/config.nix @@ -16,6 +16,11 @@ time.timeZone = "Asia/Kolkata"; i18n.defaultLocale = "en_GB.UTF-8"; + virtualisation.docker.enable = true; + virtualisation.oci-containers = { + backend = "docker"; + }; + nix = { settings = { experimental-features = [ "nix-command" "flakes" ]; diff --git a/modules/dashboard/links.nix b/modules/dashboard/links.nix index d2410f3..d096ff9 100644 --- a/modules/dashboard/links.nix +++ b/modules/dashboard/links.nix @@ -59,13 +59,13 @@ 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 = "Grafana"; + # key = "g"; + # url = "http://grafana.local"; + # altUrl = "http://${host}:${toString ports.grafana}"; + # color = "#f05a28"; + # } # { # title = "Send"; # key = "f"; @@ -80,4 +80,11 @@ 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/hardware/default.nix b/modules/hardware/default.nix index 34b7e7e..cff3cd2 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -26,14 +26,14 @@ cpuFreqGovernor = "powersave"; }; services.acpid.enable = true; - services.logind = { - powerKey = "ignore"; - rebootKey = "ignore"; - lidSwitch = "ignore"; - lidSwitchDocked = "ignore"; - lidSwitchExternalPower = "ignore"; - hibernateKey = "ignore"; - suspendKey = "ignore"; + services.logind.settings.Login = { + HandlePowerKey = "ignore"; + HandleRebootKey = "ignore"; + HandleLidSwitch = "ignore"; + HandleLidSwitchDocked = "ignore"; + HandleLidSwitchExternalPower = "ignore"; + HandleHibernateKey = "ignore"; + HandleSuspendKey = "ignore"; }; # Bootloader diff --git a/modules/hardware/fs.nix b/modules/hardware/fs.nix index aaf67d6..6760433 100644 --- a/modules/hardware/fs.nix +++ b/modules/hardware/fs.nix @@ -18,8 +18,8 @@ swapDevices = [{ device = "/dev/disk/by-label/swap"; }]; # Set high limits for file watching/file handles - systemd.extraConfig = ''DefaultLimitNOFILE=65536''; - systemd.user.extraConfig = ''DefaultLimitNOFILE=65536''; + # systemd.extraConfig = ''DefaultLimitNOFILE=65536''; + # systemd.user.extraConfig = ''DefaultLimitNOFILE=65536''; boot.kernel.sysctl."fs.inotify.max_user_instances" = 8192; security.pam.loginLimits = [ { domain = "*"; type = "-"; item = "nofile"; value = "65536"; } diff --git a/modules/media/books.nix b/modules/media/books.nix new file mode 100644 index 0000000..89aacdd --- /dev/null +++ b/modules/media/books.nix @@ -0,0 +1,24 @@ +{ settings, pkgs, ... }: +{ + systemd.tmpfiles.rules = [ + "d ${settings.media.booksDir} 0770 - ${settings.media.group} - -" + ]; + + 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" + ]; + }; +} diff --git a/modules/media/default.nix b/modules/media/default.nix index 8417d0c..7925295 100644 --- a/modules/media/default.nix +++ b/modules/media/default.nix @@ -4,6 +4,7 @@ ./torrent.nix ./servarr.nix ./jellyfin.nix + # ./books.nix ]; systemd.tmpfiles.rules = [ diff --git a/modules/media/torrent.nix b/modules/media/torrent.nix index 3430882..68218af 100644 --- a/modules/media/torrent.nix +++ b/modules/media/torrent.nix @@ -11,6 +11,7 @@ services.transmission = { enable = true; group = settings.media.group; + package = pkgs.transmission_4; openRPCPort = true; settings = { "download-dir" = settings.media.downloadsDir; diff --git a/modules/network/default.nix b/modules/network/default.nix index fdd99ab..f2dae8a 100644 --- a/modules/network/default.nix +++ b/modules/network/default.nix @@ -32,6 +32,7 @@ in # "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; }; }; }; diff --git a/modules/rss/feeds.nix b/modules/rss/feeds.nix index c796e9f..829b356 100644 --- a/modules/rss/feeds.nix +++ b/modules/rss/feeds.nix @@ -25,6 +25,8 @@ in { url = "https://www.developerway.com/rss.xml"; title = "Developer way"; } { url = "https://gpanders.com/index.xml"; title = "GPanders (neovim)"; } { url = "https://bower.sh/rss"; title = "Bower blog"; } + { url = "https://developer.mozilla.org/en-US/blog/rss.xml"; title = "MDN blog"; } + { url = "https://echasnovski.com/blog.xml"; title = "Mini.nvim guy blog"; } ]; "Reddit" = [ @@ -42,6 +44,7 @@ in ]; "Dev news" = [ + { url = "https://bsky.app/profile/did:plc:635xovhsdw27inbgxukm3qtp/rss"; title = "Neovim bsky"; } { url = "https://cprss.s3.amazonaws.com/javascriptweekly.com.xml"; title = "JS weekly"; } { url = "https://cprss.s3.amazonaws.com/react.statuscode.com.xml"; title = "React status"; } { url = "https://www.totaltypescript.com/rss.xml"; title = "Total typescript"; } diff --git a/modules/storage/syncthing.nix b/modules/storage/syncthing.nix index 92f0b30..982ee71 100644 --- a/modules/storage/syncthing.nix +++ b/modules/storage/syncthing.nix @@ -27,6 +27,11 @@ in path = settings.syncthing.photosDir; devices = lib.attrNames settings.syncthing.devices; }; + artemis-books = { + label = "Books"; + path = settings.media.booksDir; + devices = lib.attrNames settings.syncthing.devices; + }; }; overrideDevices = false; -- cgit v1.3.1