Personal-use NixOS configuration

Begin work on Bluesky PDS and atmosphere

+71
+39
hosts/index/config/atmosphere/bluesky-pds.nix
··· 1 + { flakeRoot, lib, ... }: 2 + 3 + let 4 + host = "pds.encrypted.group"; 5 + 6 + blueskyPdsModule = import (flakeRoot + /packages/server/atmosphere/bluesky-pds.nix) { 7 + hosts = [ 8 + { 9 + name = "bluesky-pds.lan"; 10 + ssl = "internal"; 11 + } 12 + { 13 + name = host; 14 + ssl = "cloudflare"; 15 + 16 + useLocal = true; 17 + } 18 + ]; 19 + }; 20 + in 21 + { 22 + imports = [ 23 + blueskyPdsModule 24 + ]; 25 + 26 + services.bluesky-pds = { 27 + environmentFiles = [ "/mnt/apps/bluesky-pds/.env" ]; 28 + 29 + settings = { 30 + PDS_HOSTNAME = host; 31 + 32 + PDS_SERVICE_HANDLE_DOMAINS = lib.concatStringsSep "," [ 33 + ".${host}" 34 + ".encode42.dev" 35 + ".erora.live" 36 + ]; 37 + }; 38 + }; 39 + }
+2
hosts/index/default.nix
··· 26 26 ./config/zfs.nix 27 27 ./config/nfs.nix 28 28 29 + ./config/atmosphere/bluesky-pds.nix 30 + 29 31 ./config/databases/mysql.nix 30 32 ./config/databases/postgresql.nix 31 33
+30
packages/server/atmosphere/bluesky-pds.nix
··· 1 + { 2 + hosts ? [ ], 3 + }: 4 + 5 + { 6 + config, 7 + flakeLib, 8 + lib, 9 + ... 10 + }: 11 + 12 + { 13 + services.bluesky-pds = { 14 + enable = true; 15 + 16 + settings = { 17 + # Assumes that the server is located in the northeastern Americas 18 + PDS_CRAWLERS = lib.concatStringsSep "," [ 19 + "https://relay1.us-east.bsky.network" 20 + "https://relay.fire.hose.cam" 21 + ]; 22 + }; 23 + 24 + goat.enable = true; 25 + }; 26 + 27 + services.caddy.virtualHosts = flakeLib.mkProxies hosts '' 28 + reverse_proxy :${toString config.services.bluesky-pds.settings.PDS_PORT} 29 + ''; 30 + }