💾 Archived View for tris.fyi › projects › amethyst › quickstart-nixos.gmi captured on 2023-09-28 at 15:41:30. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous 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

This assumes you are using Nix Flakes to manage your system configuration. Add the `amethyst` GitHub repository as an input to your flake:

inputs.amethyst = {
  url = "github:an-empty-string/amethyst/main";
  inputs.nixpkgs.follows = "nixpkgs";
};

Add the module to your nixosConfiguration:

nixosConfigurations = {
  yoursystem = nixpkgs.lib.nixosSystem {
    modules = [
      ...
      amethyst.nixosModules.default
    ]
  };
};

Then configure Amethyst in a configuration module:

{
  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.

A note about nixpkgs

This would be easier if Amethyst was in nixpkgs, which I'm happy to make happen! I'm just not sure there's enough interest. Please send me an email if you want this!