Addresses juspay/services-flake#210.
I've tested this by hand with configuration:
```nix
services.grafana."grafana" = {
enable = true;
providers = [
{
name = "Databases";
type = "file";
options = {
path = ./dashboards;
foldersFromFilesStructure = true;
};
}
];
};
```
I haven't looked into it, but it might be possible to extend the
existing Grafana test to check that a folder of dashboards is loaded.
From psql docs (https://www.postgresql.org/docs/current/app-psql.html):
> psql returns 0 to the shell if it finished normally, 1 if a fatal
error of its own occurs (e.g., out of memory, file not found), 2 if the
connection to the server went bad and the session was not interactive,
and 3 if an error occurred in a script and the variable ON_ERROR_STOP
was set.
Also resolves https://github.com/juspay/services-flake/issues/107
This commit resolves the issue where `pg_isready` would fail when
`socketDir` is set and `listen_addresses` is empty. `pg_isready` is now
modified to leverage `socketDir` when it is available.
Provides us with following benefits:
- use `runtimeInputs` instead of manually exporting `PATH`
- get shellcheck by default
---------
Co-authored-by: Sridhar Ratnakumar <3998+srid@users.noreply.github.com>
* mysql service would assume that all the `*.sql` files in the directory, provided by `initialDatabases [{ schema = <directory>; … }]`, exists in a folder named [mysql-databases](291e7be83a/nix/mysql.nix (L239-L241)), after this change it would just look for all the `*.sql` files in the top-level schema directory.
* add tests
* fix: pgadmin-init
in pgadmin-8.2, the command to setup configuration db is `setup-db`
* fix: add grafana overlay
grafana 10.3.3 from upstream nixpkgs doesn’t work in darwin
* chore: free up space in ubuntu-latest
---------
Co-authored-by: shivaraj-bh <sbh69840@gmail.com>
* clickhouse init script
* clickhouse schema test
* clickhouse folder
* docs: add initialDatabases to tips & tricks
* docs: use heading anchor
* add TODO to find an alternative to start clickhouse-server during init
---------
Co-authored-by: shivaraj-bh <sbh69840@gmail.com>
If the socketDir is in tmpfs, or if it is deleted by some other process, we would want the socketDir to be created, if not already present, on restarts.
* Added option depends_on which will be useful to append extra depends_on configuration to the <name>-init process.
* more meaningful `depends_on` option's description
---------
Co-authored-by: shivaraj-bh <sbh69840@gmail.com>
* Use psql instead of postgres, as a result, use `pg_ctl` to temporarily start the postgres server in `${name}-init` process.
* Avoid creating a custom `postgresPkg` with extensions by using `apply` attribute provided by `mkOption`
* Refactor setup script, use `writeShellApplication` and resolve shell-check errors
---------
Co-authored-by: shivaraj-bh <sbh69840@gmail.com>