diff --git a/ebooks.nix b/ebooks.nix new file mode 100644 index 0000000..a6a0f5a --- /dev/null +++ b/ebooks.nix @@ -0,0 +1,26 @@ +{...}: let + domain = "ebooks.sondell.org"; + port = 8083; +in { + # + services.calibre-web = { + enable = true; + listen.port = port; + group = "backup"; + # dataDir = "/pool/media/ebooks"; + user = "jellyfin"; + options = { + enableBookUploading = true; + calibreLibrary = "/pool/media/ebooks"; + }; + }; + + services.nginx.virtualHosts.${domain} = { + forceSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://localhost:${toString port}/"; + proxyWebsockets = true; + }; + }; +} diff --git a/filebrowser.nix b/filebrowser.nix index f4408ec..9ae7e12 100644 --- a/filebrowser.nix +++ b/filebrowser.nix @@ -1,38 +1,39 @@ -{ config, pkgs, ... }: - -let - domain = "files.sondell.org"; -in { + config, + pkgs, + ... +}: let + domain = "files.sondell.org"; +in { systemd.services.filebrowser = with pkgs; { enable = true; description = "web app file explorer"; - wantedBy = [ "multi-user.target" ]; + wantedBy = ["multi-user.target"]; unitConfig = { - After="network-online.target"; + After = "network-online.target"; }; serviceConfig = { ExecStart = "${filebrowser}/bin/filebrowser -r /pool/media/ -d /var/lib/filebrowser/filebrowser.db"; - User= "jellyfin"; - Type= "simple"; + User = "jellyfin"; + Group = "backup"; + Type = "simple"; }; }; systemd.services.tailBrowser = with pkgs; { enable = false; description = "serve via tailscale filebrowser"; - wantedBy = [ "multi-user.target" ]; + wantedBy = ["multi-user.target"]; unitConfig = { - After="filebrowser.target"; + After = "filebrowser.target"; }; serviceConfig = { ExecStart = "${tailscale}/bin/tailscale serve --http 80 localhost:8080"; # User= "jellyfin"; - Type= "simple"; + Type = "simple"; }; }; - services.nginx.virtualHosts.${domain} = { forceSSL = true; enableACME = true; @@ -42,4 +43,3 @@ in }; }; } - diff --git a/flake.nix b/flake.nix index 469b7f4..082e897 100644 --- a/flake.nix +++ b/flake.nix @@ -54,7 +54,8 @@ ./jellyfin.nix ./filebrowser.nix ./tail.nix - ./ai.nix + # ./ai.nix + ./ebooks.nix # ./matrix.nix TODO does not work atm, fixit # ./coturn.nix ./vaultwarden.nix