diff --git a/nix/apache-kafka.nix b/nix/apache-kafka.nix index bca66901..53c51fd1 100644 --- a/nix/apache-kafka.nix +++ b/nix/apache-kafka.nix @@ -20,20 +20,12 @@ 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; type = types.port; }; - dataDir = lib.mkOption { - type = types.str; - default = "./data/${name}"; - description = lib.mdDoc "The apache-kafka data directory"; - }; - settings = mkOption { description = lib.mdDoc '' [Kafka broker configuration](https://kafka.apache.org/documentation.html#brokerconfigs) diff --git a/nix/cassandra.nix b/nix/cassandra.nix index afa7b0c3..bc194990 100644 --- a/nix/cassandra.nix +++ b/nix/cassandra.nix @@ -6,16 +6,8 @@ let in { options = { - enable = lib.mkEnableOption name; - package = lib.mkPackageOption pkgs "cassandra" { }; - dataDir = lib.mkOption { - type = types.str; - default = "./data/${name}"; - description = "The cassandra data directory"; - }; - listenAddress = lib.mkOption { type = types.str; description = "Listen address"; diff --git a/nix/clickhouse/default.nix b/nix/clickhouse/default.nix index 29589cb0..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"; @@ -21,12 +19,6 @@ in default = 9000; }; - dataDir = lib.mkOption { - type = types.str; - default = "./data/${name}"; - description = "The clickhouse data directory"; - }; - defaultExtraConfig = lib.mkOption { type = yamlFormat.type; internal = true; diff --git a/nix/elasticsearch.nix b/nix/elasticsearch.nix index bb215b75..c974d218 100644 --- a/nix/elasticsearch.nix +++ b/nix/elasticsearch.nix @@ -17,16 +17,8 @@ in }; } ''; - enable = lib.mkEnableOption name; - package = lib.mkPackageOption pkgs "elasticsearch7" { }; - dataDir = lib.mkOption { - type = types.str; - default = "./data/${name}"; - description = "Directory where elasticsearch stores its data."; - }; - listenAddress = lib.mkOption { description = "Elasticsearch listen address."; default = "127.0.0.1"; diff --git a/nix/grafana.nix b/nix/grafana.nix index 29ab6cdc..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 { @@ -31,12 +29,6 @@ in default = "http"; }; - dataDir = lib.mkOption { - type = types.str; - description = "Directory where grafana stores its logs and data."; - default = "./data/${name}"; - }; - extraConf = lib.mkOption { type = iniFormat.type; description = "Extra configuration for grafana."; diff --git a/nix/lib.nix b/nix/lib.nix index 554ac9ca..653329df 100644 --- a/nix/lib.nix +++ b/nix/lib.nix @@ -15,6 +15,12 @@ ]; serviceModule = { config, name, ... }: { options = { + enable = lib.mkEnableOption "Enable the ${service}. service"; + dataDir = lib.mkOption { + type = lib.types.str; + default = "./data/${name}"; + description = "The directory where all data for `${service}.` is stored"; + }; namespace = lib.mkOption { description = '' Namespace for the ${service} service diff --git a/nix/mysql/default.nix b/nix/mysql/default.nix index e4bf1276..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"; @@ -15,12 +13,6 @@ in defaultText = lib.literalExpression "pkgs.mariadb"; }; - dataDir = lib.mkOption { - type = types.str; - default = "./data/${name}"; - description = "The mysql data directory"; - }; - socketDir = lib.mkOption { type = types.nullOr types.str; default = config.dataDir; diff --git a/nix/nginx/default.nix b/nix/nginx/default.nix index 4ad3b15a..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; @@ -41,12 +39,6 @@ in description = "The nginx package to use."; }; - dataDir = lib.mkOption { - type = types.str; - default = "./data/${name}"; - description = "The nginx data directory"; - }; - port = lib.mkOption { type = types.port; default = 8080; diff --git a/nix/ollama.nix b/nix/ollama.nix index a4689276..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; @@ -25,14 +24,7 @@ in example = "0.0.0.0"; description = "The host on which the Ollama service's REST API will listen"; }; - dataDir = lib.mkOption { - type = types.str; - default = "./data/${name}"; - description = '' - The directory containing the Ollama models. - Sets the `OLLAMA_MODELS` environment variable. - ''; - }; + keepAlive = lib.mkOption { type = types.str; default = "5m"; diff --git a/nix/open-webui.nix b/nix/open-webui.nix index 4fba54dd..bd73fa88 100644 --- a/nix/open-webui.nix +++ b/nix/open-webui.nix @@ -5,15 +5,8 @@ let in { options = { - enable = lib.mkEnableOption "Open-WebUI server"; package = lib.mkPackageOption pkgs "open-webui" { }; - dataDir = lib.mkOption { - type = types.str; - default = "./data/${name}"; - description = "The Open-WebUI data directory"; - }; - host = lib.mkOption { type = types.str; default = "127.0.0.1"; diff --git a/nix/pgadmin.nix b/nix/pgadmin.nix index 009aa62a..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 { @@ -58,12 +56,6 @@ in default = 6; }; - dataDir = lib.mkOption { - type = types.str; - default = "./data/${name}"; - description = "The pgadmin4 data directory"; - }; - extraDefaultConfig = lib.mkOption { type = pyType; internal = true; diff --git a/nix/postgres/default.nix b/nix/postgres/default.nix index 5358da76..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"; @@ -44,12 +42,6 @@ in ''; }; - dataDir = lib.mkOption { - type = lib.types.str; - default = "./data/${name}"; - description = "The DB data directory"; - }; - socketDir = lib.mkOption { type = lib.types.str; default = ""; diff --git a/nix/prometheus.nix b/nix/prometheus.nix index 6714bd80..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 { @@ -21,12 +19,6 @@ in description = lib.mdDoc "Address to listen on for the web interface, API, and telemetry"; }; - dataDir = lib.mkOption { - type = types.str; - default = "./data/${name}"; - description = "The prometheus data directory"; - }; - extraFlags = lib.mkOption { type = types.listOf types.str; default = [ ]; diff --git a/nix/redis-cluster.nix b/nix/redis-cluster.nix index f72eeb6c..ea9626d7 100644 --- a/nix/redis-cluster.nix +++ b/nix/redis-cluster.nix @@ -4,16 +4,8 @@ let in { options = { - enable = lib.mkEnableOption name; - package = lib.mkPackageOption pkgs "redis" { }; - dataDir = lib.mkOption { - type = types.str; - default = "./data/${name}"; - description = "The redis-cluster data directory (common for all nodes)."; - }; - nodes = lib.mkOption { type = types.attrsOf (types.submodule { options = { diff --git a/nix/redis.nix b/nix/redis.nix index 8c36a620..decef6f0 100644 --- a/nix/redis.nix +++ b/nix/redis.nix @@ -5,16 +5,8 @@ let in { options = { - enable = lib.mkEnableOption name; - package = lib.mkPackageOption pkgs "redis" { }; - dataDir = lib.mkOption { - type = types.str; - default = "./data/${name}"; - description = "The redis data directory"; - }; - bind = lib.mkOption { type = types.nullOr types.str; default = "127.0.0.1"; 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 4a7def01..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 { @@ -24,12 +22,6 @@ in default = 3200; }; - dataDir = lib.mkOption { - type = types.str; - default = "./data/${name}"; - description = "The tempo data directory"; - }; - extraConfig = lib.mkOption { type = yamlFormat.type; default = { }; diff --git a/nix/weaviate.nix b/nix/weaviate.nix index d6c263ad..d2ec7e4f 100644 --- a/nix/weaviate.nix +++ b/nix/weaviate.nix @@ -8,16 +8,8 @@ let in { options = { - enable = lib.mkEnableOption name; - package = lib.mkPackageOption pkgs "weaviate" { }; - dataDir = lib.mkOption { - type = types.str; - default = "./data/${name}"; - description = "Path to the Weaviate data store"; - }; - host = lib.mkOption { type = types.str; default = "127.0.0.1"; diff --git a/nix/zookeeper.nix b/nix/zookeeper.nix index 846f7380..cb541399 100644 --- a/nix/zookeeper.nix +++ b/nix/zookeeper.nix @@ -4,22 +4,12 @@ with lib; { options = { - enable = mkEnableOption (lib.mdDoc "Zookeeper"); - port = mkOption { description = lib.mdDoc "Zookeeper Client port."; default = 2181; type = types.port; }; - dataDir = mkOption { - type = types.str; - default = "./data/${name}"; - description = lib.mdDoc '' - Data directory for Zookeeper - ''; - }; - id = mkOption { description = lib.mdDoc "Zookeeper ID."; default = 0;