# `WardrikDaemon.Dirs`

The directories the daemon keeps things in.

They follow the XDG base directories, so what you write stays apart from what the daemon writes.
Each one's environment variable moves it.

| Variable | Default | Holds |
| --- | --- | --- |
| `WARDRIK_CONFIG_DIR` | `~/.config/wardrik` | `config.yaml`, `agents/` and `policies/` |
| `WARDRIK_DATA_DIR` | `~/.local/share/wardrik/store` | the store |
| `WARDRIK_DATA_HOME` | `~/.local/share/wardrik` | `vault_key` and `cli_token` |
| `WARDRIK_STATE_DIR` | `~/.local/state/wardrik` | logs |
| `WARDRIK_ENV_FILE` | `env` in the config directory | variables the daemon sets where its environment doesn't |

The defaults follow `XDG_CONFIG_HOME`, `XDG_DATA_HOME` and `XDG_STATE_HOME` where they're set.

# `t`

```elixir
@type t() :: %WardrikDaemon.Dirs{
  config: Path.t(),
  data: Path.t(),
  data_home: Path.t(),
  env_file: Path.t(),
  state: Path.t()
}
```

# `config`

```elixir
@spec config(t(), String.t()) :: Path.t()
```

Returns the path of `name` in the config directory, as `agents` or `config.yaml`.

# `data_home`

```elixir
@spec data_home(t(), String.t()) :: Path.t()
```

Returns the path of `name` in the data home, as `cli_token`.

# `new`

```elixir
@spec new(%{required(String.t()) =&gt; String.t()}) :: t()
```

Returns the directories `env`, a map of environment variables, names.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
