Website of atproto.fr
Astro 69.3%
TypeScript 25.9%
Nix 3.7%
CSS 0.8%
JavaScript 0.3%
1 2 0

Clone this repository

https://tangled.org/edouard.paris/atproto.fr https://tangled.org/did:plc:sl7e2yuycnqjk24jdjmeuidn/atproto.fr
git@knot.edouard.paris:edouard.paris/atproto.fr git@knot.edouard.paris:did:plc:sl7e2yuycnqjk24jdjmeuidn/atproto.fr

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

ATproto FR#

French-language directory and blog for the AT Protocol ecosystem.

Development#

nix develop
npm install
npm run dev

Deployment with NixOS#

The flake provides a NixOS module that packages the source code and all npm dependencies in the Nix store. No git clone or npm install needed on the server.

How it works#

Since astro build fetches data from AT Protocol APIs at build time (PLC directory, Bluesky, PDS), the full build can't run inside the Nix sandbox. Instead:

  1. packages.default — packages the source + node_modules into the Nix store via buildNpmPackage
  2. systemd.services.atproto-fr-build — runs astro build directly from the Nix store, writing output to a writable dataDir
  3. systemd.timers.atproto-fr-build — triggers rebuilds on a schedule (default: hourly)

Cached API data (public/data/) is written to dataDir via the ATPROTO_FR_DATA_DIR env var and preserved across rebuilds, so the resolvedAt-based DID caching works.

1. Add the flake input#

{
  inputs = {
    atproto-fr.url = "github:your-user/atproto-fr";
  };
}

2. Get the npm dependency hash#

nix build .#default 2>&1 | grep 'got:'

Replace the sha256-FIXME in flake.nix with the hash from the output.

3. Import the module and enable the service#

{ inputs, ... }: {
  imports = [ inputs.atproto-fr.nixosModules.default ];

  services.atproto-fr = {
    enable = true;
    package = inputs.atproto-fr.packages.${system}.default;
    interval = "hourly";  # systemd calendar expression
  };
}

4. Serve with Caddy#

services.caddy = {
  enable = true;
  virtualHosts."atproto.fr" = {
    extraConfig = ''
      root * /var/lib/atproto-fr/dist
      file_server
      encode gzip

      handle_errors {
        rewrite * /404.html
        file_server
      }
    '';
  };
};

5. Trigger an initial build#

# Trigger first build manually
systemctl start atproto-fr-build

# Verify the timer is active
systemctl list-timers atproto-fr-build

Module options#

Option Default Description
enable false Enable the rebuild service
package The atproto-fr package (source + node_modules)
dataDir /var/lib/atproto-fr Writable directory for build output and cached data
interval "hourly" Systemd calendar expression
user "atproto-fr" System user for builds
group "atproto-fr" System group for builds