Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fmt; add kafka and zk service to readme #54

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ TODO

## Services available

- [x] PostgreSQL
- [x] Apache Kafka
- [x] Elasticsearch
- [x] MySQL
- [x] PostgreSQL
- [x] Redis
- [x] Redis Cluster
- [x] Elasticsearch
- [x] Zookeeper
- [ ] ...

## A note on process working directory
Expand Down
7 changes: 4 additions & 3 deletions nix/default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{ pkgs, lib, ... }:
let
inherit (import ./lib.nix) multiService;
in {
in
{
imports = builtins.map multiService [
./apache-kafka.nix
./elasticsearch.nix
./mysql.nix
./postgres.nix
./redis.nix
./redis-cluster.nix
./elasticsearch.nix
./redis.nix
./zookeeper.nix
];
}
6 changes: 4 additions & 2 deletions nix/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
# 'name' parameter, and is expected to set the final process-compose config in
# its `outputs.settings` option.
multiService = mod:
{ config, pkgs, lib, ... }: let
{ config, pkgs, lib, ... }:
let
# Derive name from filename
name = lib.pipe mod [
builtins.baseNameOf
(lib.strings.splitString ".")
builtins.head
];
in {
in
{
options.services.${name} = lib.mkOption {
description = ''
${name} service
Expand Down
2 changes: 1 addition & 1 deletion nix/postgres.nix
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ in
initdbArgs =
config.initdbArgs
++ (lib.optionals (config.superuser != null) [ "-U" config.superuser ])
++ ["-D" config.dataDir ];
++ [ "-D" config.dataDir ];

setupScript = pkgs.writeShellScriptBin "setup-postgres" ''
set -euo pipefail
Expand Down