Skip to content

Services

processes are a low-level interface to starting a tool, while services provide a higher level configuration.

Here's an example starting PostgreSQL with a few extensions:

devenv.nix
{ pkgs, ... }:

{
  services.postgres = {
    enable = true;
    package = pkgs.postgresql_15;
    initialDatabases = [{ name = "mydb"; }];
    extensions = extensions: [
      extensions.postgis
      extensions.timescaledb
    ];
    settings.shared_preload_libraries = "timescaledb";
    initialScript = "CREATE EXTENSION IF NOT EXISTS timescaledb;";
  };
}

Services start like processes with devenv up:

$ devenv up
Starting processes ...

Service states are persisted to directories in $DEVENV_DOTFILE/state. When you adjust options like the above used initialScript, you will have to delete the service's directory for changes to take effect on next devenv up.

Supported services

services.adminer.enable = true;
services.blackfire.enable = true;
services.caddy.enable = true;
services.cassandra.enable = true;
services.clickhouse.enable = true;
services.couchdb.enable = true;
services.elasticsearch.enable = true;
services.mailhog.enable = true;
services.meilisearch.enable = true;
services.memcached.enable = true;
services.minio.enable = true;
services.mongodb.enable = true;
services.mysql.enable = true;
services.nginx.enable = true;
services.opensearch.enable = true;
services.postgres.enable = true;
services.rabbitmq.enable = true;
services.redis.enable = true;
services.temporal.enable = true;
services.varnish.enable = true;
services.vault.enable = true;
services.wiremock.enable = true;

You can find all supported options for services here.