From 9ccceca9aaebecc1004a6b644372ec81f081a570 Mon Sep 17 00:00:00 2001 From: shivaraj-bh Date: Fri, 5 Jul 2024 23:30:15 +0530 Subject: [PATCH] refactor: Do not repeat `enable` option --- nix/apache-kafka.nix | 2 -- nix/cassandra.nix | 2 -- nix/clickhouse/default.nix | 2 -- nix/elasticsearch.nix | 2 -- nix/grafana.nix | 2 -- nix/lib.nix | 1 + nix/mysql/default.nix | 2 -- nix/nginx/default.nix | 2 -- nix/ollama.nix | 1 - nix/open-webui.nix | 1 - nix/pgadmin.nix | 2 -- nix/postgres/default.nix | 2 -- nix/prometheus.nix | 2 -- nix/redis-cluster.nix | 2 -- nix/redis.nix | 2 -- nix/searxng.nix | 1 - nix/tempo.nix | 2 -- nix/weaviate.nix | 2 -- nix/zookeeper.nix | 2 -- 19 files changed, 1 insertion(+), 33 deletions(-) diff --git a/nix/apache-kafka.nix b/nix/apache-kafka.nix index 64196ad8..53c51fd1 100644 --- a/nix/apache-kafka.nix +++ b/nix/apache-kafka.nix @@ -20,8 +20,6 @@ in with lib; { options = { - enable = mkEnableOption (lib.mdDoc "Apache Kafka event streaming broker"); - port = mkOption { description = lib.mdDoc "Port number the broker should listen on."; default = 9092; diff --git a/nix/cassandra.nix b/nix/cassandra.nix index 4d8f9fa2..bc194990 100644 --- a/nix/cassandra.nix +++ b/nix/cassandra.nix @@ -6,8 +6,6 @@ let in { options = { - enable = lib.mkEnableOption name; - package = lib.mkPackageOption pkgs "cassandra" { }; listenAddress = lib.mkOption { diff --git a/nix/clickhouse/default.nix b/nix/clickhouse/default.nix index 735ce971..6a4d7d57 100644 --- a/nix/clickhouse/default.nix +++ b/nix/clickhouse/default.nix @@ -6,8 +6,6 @@ let in { options = { - enable = lib.mkEnableOption name; - package = lib.mkOption { type = types.package; description = "Which package of clickhouse to use"; diff --git a/nix/elasticsearch.nix b/nix/elasticsearch.nix index 4af27d55..c974d218 100644 --- a/nix/elasticsearch.nix +++ b/nix/elasticsearch.nix @@ -17,8 +17,6 @@ in }; } ''; - enable = lib.mkEnableOption name; - package = lib.mkPackageOption pkgs "elasticsearch7" { }; listenAddress = lib.mkOption { diff --git a/nix/grafana.nix b/nix/grafana.nix index 2e000c7b..0c83d028 100644 --- a/nix/grafana.nix +++ b/nix/grafana.nix @@ -9,8 +9,6 @@ in description = '' Configure grafana. ''; - enable = lib.mkEnableOption name; - package = lib.mkPackageOption pkgs "grafana" { }; http_port = lib.mkOption { diff --git a/nix/lib.nix b/nix/lib.nix index e02ef0c2..653329df 100644 --- a/nix/lib.nix +++ b/nix/lib.nix @@ -15,6 +15,7 @@ ]; serviceModule = { config, name, ... }: { options = { + enable = lib.mkEnableOption "Enable the ${service}. service"; dataDir = lib.mkOption { type = lib.types.str; default = "./data/${name}"; diff --git a/nix/mysql/default.nix b/nix/mysql/default.nix index 22282cad..b3434d07 100644 --- a/nix/mysql/default.nix +++ b/nix/mysql/default.nix @@ -6,8 +6,6 @@ with lib.types; let in { options = { - enable = lib.mkEnableOption "MySQL process and expose utilities"; - package = lib.mkOption { type = types.package; description = "Which package of MySQL to use"; diff --git a/nix/nginx/default.nix b/nix/nginx/default.nix index 1d5d81af..7f21b327 100644 --- a/nix/nginx/default.nix +++ b/nix/nginx/default.nix @@ -32,8 +32,6 @@ in { options = { - enable = lib.mkEnableOption "nginx"; - package = lib.mkOption { type = lib.types.package; default = pkgs.nginx; diff --git a/nix/ollama.nix b/nix/ollama.nix index 7d89b176..e8f9015b 100644 --- a/nix/ollama.nix +++ b/nix/ollama.nix @@ -8,7 +8,6 @@ let in { options = { - enable = lib.mkEnableOption "Enable the Ollama service"; package = lib.mkOption { type = types.package; default = ollamaPackage; diff --git a/nix/open-webui.nix b/nix/open-webui.nix index b80be571..bd73fa88 100644 --- a/nix/open-webui.nix +++ b/nix/open-webui.nix @@ -5,7 +5,6 @@ let in { options = { - enable = lib.mkEnableOption "Open-WebUI server"; package = lib.mkPackageOption pkgs "open-webui" { }; host = lib.mkOption { diff --git a/nix/pgadmin.nix b/nix/pgadmin.nix index a47caab4..674860f7 100644 --- a/nix/pgadmin.nix +++ b/nix/pgadmin.nix @@ -25,8 +25,6 @@ let in { options = { - enable = lib.mkEnableOption name; - package = lib.mkPackageOption pkgs "pgadmin4" { }; host = lib.mkOption { diff --git a/nix/postgres/default.nix b/nix/postgres/default.nix index 7b750f04..1df1d26f 100644 --- a/nix/postgres/default.nix +++ b/nix/postgres/default.nix @@ -5,8 +5,6 @@ with lib.types; let in { options = { - enable = lib.mkEnableOption name; - package = lib.mkOption { type = types.package; description = "Which package of postgresql to use"; diff --git a/nix/prometheus.nix b/nix/prometheus.nix index 45d6a5b7..f3fc28a0 100644 --- a/nix/prometheus.nix +++ b/nix/prometheus.nix @@ -5,8 +5,6 @@ let in { options = { - enable = lib.mkEnableOption name; - package = lib.mkPackageOption pkgs "prometheus" { }; port = lib.mkOption { diff --git a/nix/redis-cluster.nix b/nix/redis-cluster.nix index af210e3d..ea9626d7 100644 --- a/nix/redis-cluster.nix +++ b/nix/redis-cluster.nix @@ -4,8 +4,6 @@ let in { options = { - enable = lib.mkEnableOption name; - package = lib.mkPackageOption pkgs "redis" { }; nodes = lib.mkOption { diff --git a/nix/redis.nix b/nix/redis.nix index c8f4c934..decef6f0 100644 --- a/nix/redis.nix +++ b/nix/redis.nix @@ -5,8 +5,6 @@ let in { options = { - enable = lib.mkEnableOption name; - package = lib.mkPackageOption pkgs "redis" { }; bind = lib.mkOption { diff --git a/nix/searxng.nix b/nix/searxng.nix index efad80fd..600dfb14 100644 --- a/nix/searxng.nix +++ b/nix/searxng.nix @@ -5,7 +5,6 @@ let in { options = { - enable = lib.mkEnableOption name; package = lib.mkPackageOption pkgs "searxng" { }; host = lib.mkOption { diff --git a/nix/tempo.nix b/nix/tempo.nix index b2d85151..e9cdc2c0 100644 --- a/nix/tempo.nix +++ b/nix/tempo.nix @@ -8,8 +8,6 @@ in description = '' Configure tempo. ''; - enable = lib.mkEnableOption name; - package = lib.mkPackageOption pkgs "tempo" { }; httpAddress = lib.mkOption { diff --git a/nix/weaviate.nix b/nix/weaviate.nix index dd305028..d2ec7e4f 100644 --- a/nix/weaviate.nix +++ b/nix/weaviate.nix @@ -8,8 +8,6 @@ let in { options = { - enable = lib.mkEnableOption name; - package = lib.mkPackageOption pkgs "weaviate" { }; host = lib.mkOption { diff --git a/nix/zookeeper.nix b/nix/zookeeper.nix index b6ae604b..cb541399 100644 --- a/nix/zookeeper.nix +++ b/nix/zookeeper.nix @@ -4,8 +4,6 @@ with lib; { options = { - enable = mkEnableOption (lib.mdDoc "Zookeeper"); - port = mkOption { description = lib.mdDoc "Zookeeper Client port."; default = 2181;