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 --- .gitignore | 1 + flake.lock | 18 +++++++++--------- 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 +++++ settings.nix | 3 +++ 13 files changed, 77 insertions(+), 26 deletions(-) create mode 100644 modules/media/books.nix diff --git a/.gitignore b/.gitignore index 66b3819..0130c5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.private.* *.ignore.* +tmp/ diff --git a/flake.lock b/flake.lock index 6e6adf3..c7d3e58 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1751432711, - "narHash": "sha256-136MeWtckSHTN9Z2WRNRdZ8oRP3vyx3L8UxeBYE+J9w=", + "lastModified": 1762463231, + "narHash": "sha256-hv1mG5j5PTbnWbtHHomzTus77pIxsc4x8VrMjc7+/YE=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "497ae1357f1ac97f1aea31a4cb74ad0d534ef41f", + "rev": "52113c4f5cfd1e823001310e56d9c8d0699a6226", "type": "github" }, "original": { @@ -35,11 +35,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1751271578, - "narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=", + "lastModified": 1762596750, + "narHash": "sha256-rXXuz51Bq7DHBlfIjN7jO8Bu3du5TV+3DSADBX7/9YQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df", + "rev": "b6a8526db03f735b89dd5ff348f53f752e7ddc8e", "type": "github" }, "original": { @@ -57,11 +57,11 @@ ] }, "locked": { - "lastModified": 1751467228, - "narHash": "sha256-lSpl9VvM8w2EubJknlprmSEKsG8hAXIafSIL3kzfkPA=", + "lastModified": 1756881979, + "narHash": "sha256-JVK+Ea2Qxm2Z7HhbaaRp70vtCZJERak3S4Sw2TP2QxQ=", "owner": "phenax", "repo": "yayarr", - "rev": "9999ab4cfd8375062b4b2f8cd16788c11c436819", + "rev": "0571aea9e98ceeb746ad963f0e5c79709cd91f13", "type": "github" }, "original": { 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; diff --git a/settings.nix b/settings.nix index cf110cc..5696874 100644 --- a/settings.nix +++ b/settings.nix @@ -21,6 +21,7 @@ in lib.recursiveUpdate privateSettings rec { send = 1443; immich = 3144; yarr = 7070; + lazylibrarian = 5299; }; exposeTransmissionRPC = false; }; @@ -48,6 +49,8 @@ in lib.recursiveUpdate privateSettings rec { tvDir = "${baseDir}/tv"; moviesDir = "${baseDir}/movies"; musicDir = "${baseDir}/music"; + booksDir = "${baseDir}/books"; group = "multimedia"; + # booksGroup = "books"; }; } -- cgit v1.3.1