Quick Start¶
A running Gradient instance with its own worker, on one NixOS host. Standalone has a first try without a NixOS host.
Requirements:
- A NixOS host configured through a flake
- A domain pointing at that host, for example
gradient.example.com
1. Flake Input¶
# flake.nix
{
inputs.gradient.url = "github:wavelens/gradient/latest"; # (1)!
outputs = { nixpkgs, gradient, ... }: {
nixosConfigurations.gradient = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
gradient.nixosModules.default # (2)!
];
};
};
}
- The flake ref
github:wavelens/gradienttracks every commit onmain. Usegithub:wavelens/gradient/betato include pre-releases. - The flake provides the
services.gradientoptions for the server, the worker and the declarative state.
2. Create Secrets¶
install -d -m 700 /var/lib/gradient-secrets
openssl rand -base64 48 > /var/lib/gradient-secrets/jwt
openssl rand -base64 48 > /var/lib/gradient-secrets/crypt
jwt is the key for signing login sessions. crypt is the key for encrypting secrets stored in the database. The worker will create its own token without any file here.
3. Enable Gradient¶
Add this to configuration.nix:
# configuration.nix
{ pkgs, ... }:
{
services.gradient = {
enable = true;
domain = "gradient.example.com"; # (1)!
secrets.jwtFile = "/var/lib/gradient-secrets/jwt";
secrets.cryptFile = "/var/lib/gradient-secrets/crypt";
postgres.enable = true; # (2)!
worker.enable = true; # (3)!
};
services.postgresql.package = pkgs.postgresql_18; # (4)!
}
- An nginx virtual host from the module, answering on this domain. Only set it to false if you know what you are doing.
- A local PostgreSQL database for Gradient.
- A worker on the same host with automatic self-registration at startup. Admins grant this worker to each project. See First Project. Only superusers can create projects with this worker enabled.
- Gradient needs PostgreSQL 18 or newer. The NixOS default may be older.
Verify Deployment¶
- The login page is reachable at
https://gradient.example.com. systemctl status gradient-server gradient-workershows both services running.
Connection attempts from the local worker continue until a project with a cache grants team server the workers flag. That loop is normal at this stage. All three steps appear on the next page.
Next Steps¶
- First Project walks through creating a project, warming the cache and getting the first build to pass
- Installation covers TLS, reverse proxies and a production-ready setup
- Configuration documents every server and worker option