# couchdb

## Options

### services.couchdb.enable

Whether to enable CouchDB process.

*Type:* boolean

*Default:*

```nix
false
```

*Example:*

```nix
true
```

*Declared by:*

* <https://github.com/cachix/devenv/blob/main/src/modules/services/couchdb.nix>

### services.couchdb.package

Which version of CouchDB to use

*Type:* package

*Default:*

```nix
pkgs.couchdb3
```

*Declared by:*

* <https://github.com/cachix/devenv/blob/main/src/modules/services/couchdb.nix>

### services.couchdb.baseDir

The directory where CouchDB will store its data.

*Type:* string *(read only)*

*Default:*

```nix
config.env.DEVENV_STATE + "/couchdb"
```

*Declared by:*

* <https://github.com/cachix/devenv/blob/main/src/modules/services/couchdb.nix>

### services.couchdb.settings

CouchDB configuration. To learn more about all settings, see the [CouchDB configuration reference](https://docs.couchdb.org/en/stable/config/couchdb.html).

*Type:* open submodule of attribute set of section of an INI file (attrs of INI atom (null, bool, int, float or string))

*Default:*

```nix
{ }
```

*Example:*

```nix
{
  couchdb = {
    database_dir = baseDir;
    single_node = true;
    view_index_dir = baseDir;
    uri_file = "${config.services.couchdb.baseDir}/couchdb.uri";
  };
  admins = {
    "admin_username" = "pass";
  };
  chttpd = {
    bind_address = "127.0.0.1";
    port = 5984;
  };
}
```

*Declared by:*

* <https://github.com/cachix/devenv/blob/main/src/modules/services/couchdb.nix>

### services.couchdb.settings.chttpd.bind\_address

Defines the IP address by which CouchDB will be accessible.

*Type:* string

*Default:*

```nix
"127.0.0.1"
```

*Declared by:*

* <https://github.com/cachix/devenv/blob/main/src/modules/services/couchdb.nix>

### services.couchdb.settings.chttpd.port

Defined the port number to listen.

*Type:* 16 bit unsigned integer; between 0 and 65535 (both inclusive)

*Default:*

```nix
5984
```

*Declared by:*

* <https://github.com/cachix/devenv/blob/main/src/modules/services/couchdb.nix>

### services.couchdb.settings.couchdb.database\_dir

Specifies location of CouchDB database files (\*.couch named). This location should be writable and readable for the user the CouchDB service runs as (couchdb by default).

*Type:* absolute path

*Default:*

```nix
config.env.DEVENV_STATE + "/couchdb"
```

*Declared by:*

* <https://github.com/cachix/devenv/blob/main/src/modules/services/couchdb.nix>

### services.couchdb.settings.couchdb.single\_node

When this configuration setting is set to true, automatically create the system databases on startup. Must be set false for a clustered CouchDB installation.

*Type:* boolean

*Default:*

```nix
true
```

*Declared by:*

* <https://github.com/cachix/devenv/blob/main/src/modules/services/couchdb.nix>

### services.couchdb.settings.couchdb.uri\_file

This file contains the full URI that can be used to access this instance of CouchDB. It is used to help discover the port CouchDB is running on (if it was set to 0 (e.g. automatically assigned any free one). This file should be writable and readable for the user that runs the CouchDB service (couchdb by default).

*Type:* absolute path

*Default:*

```nix
config.env.DEVENV_STATE + "/couchdb"/couchdb.uri
```

*Declared by:*

* <https://github.com/cachix/devenv/blob/main/src/modules/services/couchdb.nix>

### services.couchdb.settings.couchdb.view\_index\_dir

Specifies location of CouchDB view index files. This location should be writable and readable for the user that runs the CouchDB service (couchdb by default).

*Type:* absolute path

*Default:*

```nix
config.env.DEVENV_STATE + "/couchdb"
```

*Declared by:*

* <https://github.com/cachix/devenv/blob/main/src/modules/services/couchdb.nix>