diff --git a/README.md b/README.md index e0528dc..aec3361 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 0103365..122e318 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 45a4a4e..ebf6bf0 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 05a17d2..5382913 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