diff --git a/audiobooks.nix b/audiobooks.nix new file mode 100644 index 0000000..02cb859 --- /dev/null +++ b/audiobooks.nix @@ -0,0 +1,27 @@ +{ config, ... }: + +let + domain = "books.sondell.org"; + # derp = "hi"; +in +{ + # + services.audiobookshelf = { + enable = true; + port = 8000; + }; + + + services.nginx.virtualHosts.${domain} = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://localhost:8000/"; + proxyWebsockets = true; + # extraConfig = '' + # access_log /var/log/nginx/access.log main if=$forgejo_access_log; + # ''; + }; + }; +} + diff --git a/forgejo.nix b/forgejo.nix new file mode 100644 index 0000000..a09afeb --- /dev/null +++ b/forgejo.nix @@ -0,0 +1,53 @@ +{ config, ... }: + +let + domain = "git.glennwso.com"; + # derp = "hi"; +in +{ + security.acme = { + acceptTerms = true; + defaults = { + email = "glennpub@proton.me"; + dnsProvider = "cloudflare"; + # # location of your CLOUDFLARE_DNS_API_TOKEN=[value] + # # https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#EnvironmentFile= + environmentFile = "/etc/nixos/.secrets/cloudflare_dns_tokend"; + }; + }; + networking.firewall.allowedTCPPorts = [ 80 443 3000 ]; + services.forgejo = { + enable = true; + settings = { + service = { + # DISABLE_REGISTRATION = true; + }; + server = { + ROOT_URL = "https://${domain}/"; + LANDING_PAGE = "explore"; + }; + }; + }; + + services.nginx = { + enable = true; + appendHttpConfig = '' + map $uri $forgejo_access_log { + default 1; + /api/actions/runner.v1.RunnerService/FetchTask 0; + } + ''; + }; + + services.nginx.virtualHosts.${domain} = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://localhost:3000/"; + # extraConfig = '' + # access_log /var/log/nginx/access.log main if=$forgejo_access_log; + # ''; + }; + }; +} + diff --git a/jellyfin.nix b/jellyfin.nix new file mode 100644 index 0000000..0675dcb --- /dev/null +++ b/jellyfin.nix @@ -0,0 +1,26 @@ +{ config, ... }: + +let + domain = "jelly.sondell.org"; + # derp = "hi"; +in +{ + # + services.jellyfin = { + enable = true; + }; + + + services.nginx.virtualHosts.${domain} = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://localhost:8096/"; + proxyWebsockets = true; + # extraConfig = '' + # access_log /var/log/nginx/access.log main if=$forgejo_access_log; + # ''; + }; + }; +} + diff --git a/nextcloud.nix b/nextcloud.nix new file mode 100644 index 0000000..4b883a2 --- /dev/null +++ b/nextcloud.nix @@ -0,0 +1,62 @@ +{ self, config, lib, pkgs, ... }: +let domain = "cloud.sondell.org"; +in +{ + # Based on https://carjorvaz.com/posts/the-holy-grail-nextcloud-setup-made-easy-by-nixos/ + # security.acme = { + # acceptTerms = true; + # defaults = { + # email = "glennpub@proton.me"; + # dnsProvider = "cloudflare"; + # # # location of your CLOUDFLARE_DNS_API_TOKEN=[value] + # # # https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#EnvironmentFile= + # environmentFile = "/REPLACE/WITH/YOUR/PATH"; + # }; + # }; + + services = { + nginx.virtualHosts = { + ${domain} = { + forceSSL = true; + enableACME = true; + # Use DNS Challenege. + # acmeRoot = null; + }; + }; + # + nextcloud = { + enable = true; + hostName = domain; + # Need to manually increment with every major upgrade. + package = pkgs.nextcloud28; + # Let NixOS install and configure the database automatically. + database.createLocally = true; + # Let NixOS install and configure Redis caching automatically. + configureRedis = true; + # Increase the maximum file upload size. + maxUploadSize = "16G"; + https = true; + autoUpdateApps.enable = true; + extraAppsEnable = true; + extraApps = with config.services.nextcloud.package.packages.apps; { + # List of apps we want to install and are already packaged in + # https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/nextcloud/packages/nextcloud-apps.json + inherit mail calendar contacts notes onlyoffice tasks cookbook; + }; + config = { + overwriteProtocol = "https"; + # defaultPhoneRegion = "US"; + dbtype = "pgsql"; + adminuser = "admin"; + adminpassFile = "/etc/nixos/.secrets/nextadminpw"; + }; + # Suggested by Nextcloud's health check. + phpOptions."opcache.interned_strings_buffer" = "16"; + }; + # Nightly database backups. + # postgresqlBackup = { + # enable = true; + # startAt = "*-*-* 01:15:00"; + # }; + }; +}