Skip to content

Commit

Permalink
fmt; add kafka and zk service to readme (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaraj-bh authored Sep 7, 2023
1 parent 072fb57 commit 0f31f24
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
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

0 comments on commit 0f31f24

Please sign in to comment.