💾 Archived View for tris.fyi › projects › amethyst › quickstart-nixos.gmi captured on 2022-01-08 at 13:37:15. Gemini links have been rewritten to link to archived content

View Raw

More Information

➡️ Next capture (2023-01-29)

-=-=-=-=-=-=-

Amethyst Quickstart (NixOS)

Back to project page

This page describes how to install Amethyst configured for a static site with automatic TLS certificate management on NixOS.

Configuration example

Since Amethyst isn't in nixpkgs right now, you will need to import my "nixos-modules" GitHub repository as shown in the example below. (If you'd like to see Amethyst in nixpkgs, please send me an email! I just don't want to maintain it there unless there is interest.)

Here is an example "configuration.nix". I'll keep the rev / hash updated on this page as the module is updated.


{ pkgs, ... }:

let
  trisModules = pkgs.fetchFromGitHub {
    owner = "an-empty-string";
    repo = "nixos-modules";
    rev = "33e9763c66edd838eb26d5a0bce62fd0cc989d40";
    hash = "sha256-cXKrDfSkGzInn+XkZ7+zYHogEiLQ0j9r8p6pxPcl+bs=";
  });
in
{
  imports = [
    "${trisModules}/services/amethyst.nix"
  ];

  services.amethyst = {
    enable = true;
    hosts = [{
      name = "gemini.tris.fyi";
      paths."/" = {
        root = "/var/gemini";
        autoindex = true;
        cgi = true;
      };
    }];
  };
}

Hot-reloading configuration

You can reload configuration without restarting the server by sending SIGHUP to the Amethyst process.