diff options
| author | Mel <einebeere@gmail.com> | 2024-12-04 04:31:55 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2024-12-04 04:31:55 +0100 |
| commit | c5364de431203671106fd7e66a27a4c1e932c1f3 (patch) | |
| tree | e425cb12a307582a440611513c63635a2541a5b8 /services | |
| parent | fa964a8d1ab2dc83386f457b51b2de87b68cbe70 (diff) | |
| download | network-c5364de431203671106fd7e66a27a4c1e932c1f3.tar.zst network-c5364de431203671106fd7e66a27a4c1e932c1f3.zip | |
Host bare-bones Bluesky PDS service
Signed-off-by: Mel <einebeere@gmail.com>
Diffstat (limited to 'services')
| -rw-r--r-- | services/pds.nix | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/services/pds.nix b/services/pds.nix new file mode 100644 index 0000000..55dc157 --- /dev/null +++ b/services/pds.nix @@ -0,0 +1,60 @@ +{ pkgs, auxiliaryPkgs, ... }: + +let + inherit (pkgs) dockerTools glibc; + inherit (auxiliaryPkgs) common; + + inherit (auxiliaryPkgs.bluesky) pds pdsadmin; + + pdsLocalPort = 16419; + pdsDir = "/srv/pds"; + + pdsImage = dockerTools.buildLayeredImage { + name = "pds"; + tag = pds.version; + fromImage = common.alpine.base; + contents = [ pds pdsadmin glibc ]; + # this convices `detect-libc`, which is used by `sharp` + # to pick the correct binary artifact, that we're using + # glibc and not musl to choose the right one. + extraCommands = '' + mkdir -p usr/bin + ln -s ${glibc.bin}/bin/ldd usr/bin/ldd + ''; + }; + +in +{ + foundation.services.pds = { + image = { imageFile = pdsImage; image = "pds:${pds.version}"; }; + ports = [ [ pdsLocalPort 3000 ] ]; + + volumes = [ + [ "${pdsDir}" "/pds" ] + ]; + + environment = { + PDS_PORT = "3000"; + PDS_HOSTNAME = "pds.rnrd.eu"; + + PDS_DATA_DIRECTORY = "/pds"; + PDS_BLOBSTORE_DISK_LOCATION = "/pds/blocks"; + PDS_BLOB_UPLOAD_LIMIT = "52428800"; + + PDS_DID_PLC_URL = "https://plc.directory"; + PDS_BSKY_APP_VIEW_URL = "https://api.bsky.app"; + PDS_BSKY_APP_VIEW_DID = "did:web:api.bsky.app"; + PDS_REPORT_SERVICE_URL = "https://mod.bsky.app"; + PDS_REPORT_SERVICE_DID = "did:plc:ar7c4by46qjdydhdevvrndac"; + PDS_CRAWLERS = "https://bsky.network"; + + LOG_ENABLED = "true"; + }; + + # TODO: use age + environmentFiles = [ /srv/pds/secret.env ]; + + workdir = "/pds"; + entrypoint = "${pds}/bin/pds"; + }; +} |
