continuwuity/docs/deploying/nixos.mdx
Henry-Hiles fddca8d534
feat: Static musl builds via nix
fix: don't do check on all builds

Checks can be done with `nix flake check`, no need to slow down build process with this.

feat: add static binary build instructions to docs

feat: add max-perf package

feat: add build-nix workflow

chore: add changelog

fix: fix max-perf-static packages not statically linking

feat: improve docs for building with nix

chore: more descriptive name for binary build step of workflow

fix: resolve review comment about Haswell CPUs

chore: enable __structuredAttrs on build

This is a good practice for modern nix packages
2026-06-20 16:54:35 +01:00

81 lines
2.8 KiB
Text

# Continuwuity for NixOS
## Nix package
You can get a Nix package for Continuwuity from the following sources:
- Directly from Nixpkgs: `pkgs.matrix-continuwuity`
- Or, using `continuwuity.packages.${system}.default` from:
- The `flake.nix` at the root of the Continuwuity repo, by adding Continuwuity to your flake inputs:
```nix
inputs.continuwuity.url = "git+https://forgejo.ellis.link/continuwuation/continuwuity";
```
- The `default.nix` at the root of the Continuwuity repo
## NixOS module
Continuwuity has an official NixOS module that simplifies configuration and deployment. The module is available in Nixpkgs as `services.matrix-continuwuity`.
Here's a basic example of how to use the module:
```nix
services.matrix-continuwuity = {
enable = true;
settings = {
global = {
server_name = "example.com";
# Continuwuity listens on localhost by default,
# address and port are handled automatically
# You can add any further configuration here, e.g.
# trusted_servers = [ "matrix.org" ];
};
};
};
```
### Available options
The NixOS module provides these configuration options:
- `enable`: Enable the Continuwuity service
- `user`: The user to run Continuwuity as (defaults to "continuwuity")
- `group`: The group to run Continuwuity as (defaults to "continuwuity")
- `extraEnvironment`: Extra environment variables to pass to the Continuwuity server
- `package`: The Continuwuity package to use, defaults to `pkgs.matrix-continuwuity`
- You may want to override this to be from our flake, for faster updates and unstable versions:
```nix
package = inputs.continuwuity.packages.${pkgs.stdenv.hostPlatform.system}.packageName;
```
Where `packageName` is one of:
- `default`
- `max-perf`: Takes longer to build, but has more runtime optimizations
- `max-perf-haswell`: Optimized for modern CPUs, don't use if your CPU is not Haswell or later.
- `admin.enable`: Whether to add the `conduwuit` binary to `PATH` for administration (enabled by default)
- `settings`: The Continuwuity configuration
Use the `settings` option to configure Continuwuity itself. See the [example configuration file](../reference/config.mdx) for all available options.
Settings are automatically translated from Nix to TOML. For example, the following line of Nix:
```nix
settings.global.well_known.client = "https://matrix.example.com";
```
Would become this equivalent TOML configuration:
```toml
[global.well_known]
client = "https://matrix.example.com"
```
## Reverse proxy configuration
You'll need to set up a reverse proxy (like NGINX or Caddy) to expose Continuwuity to the internet. You can configure your reverse proxy using NixOS options (e.g. `services.caddy`).
See the [reverse proxy setup guide](./generic.mdx#setting-up-the-reverse-proxy) for information on correct reverse proxy configuration.