From 7cec1da5f26f335848d439c4353a876ec638944c Mon Sep 17 00:00:00 2001 From: shivaraj-bh Date: Thu, 7 Sep 2023 20:43:41 +0530 Subject: [PATCH] fmt; add kafka and zk service to readme --- README.md | 6 ++++-- nix/default.nix | 7 ++++--- nix/lib.nix | 6 ++++-- nix/postgres.nix | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e0528dc0..aec33612 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/nix/default.nix b/nix/default.nix index 0103365c..122e3187 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -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 ]; } diff --git a/nix/lib.nix b/nix/lib.nix index 45a4a4ed..ebf6bf06 100644 --- a/nix/lib.nix +++ b/nix/lib.nix @@ -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 diff --git a/nix/postgres.nix b/nix/postgres.nix index 05a17d24..53829137 100644 --- a/nix/postgres.nix +++ b/nix/postgres.nix @@ -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