44 lines
1.4 KiB
Nix
44 lines
1.4 KiB
Nix
{ config, lib, ... }: {
|
|
options.snowflake.services.containerised.qdrant = {
|
|
enable = lib.mkEnableOption "enable qdrant";
|
|
|
|
version = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = "qdrant version to use";
|
|
};
|
|
|
|
uri = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = "domain name to host qdrant on";
|
|
};
|
|
bootstrap = lib.mkOption {
|
|
type = lib.types.nullOr lib.types.str;
|
|
default = null;
|
|
description = "bootstrap name for qdrant cluster";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf config.snowflake.services.containerised.qdrant.enable {
|
|
environment.etc."qdrant/config.yaml".source = ./config.yaml;
|
|
virtualisation.oci-containers.containers.qdrant = {
|
|
autoStart = true;
|
|
image =
|
|
"docker.io/qdrant/qdrant:${config.snowflake.services.containerised.qdrant.version}";
|
|
ports = [
|
|
"6333:6333" # REST API + Web UI
|
|
# "6333:6333" # GRPC API - unused
|
|
"6335:6335" # p2p API for cluster communication
|
|
];
|
|
volumes = [
|
|
"/mnt/disk1/storage:/qdrant/storage"
|
|
"/etc/qdrant/config.yaml:/qdrant/config/config.yaml:ro"
|
|
];
|
|
cmd = [
|
|
"./qdrant"
|
|
"--uri=http://${config.snowflake.services.containerised.qdrant.uri}:6335"
|
|
] ++ lib.optional
|
|
(config.snowflake.services.containerised.qdrant.bootstrap != null)
|
|
"--bootstrap=http://${config.snowflake.services.containerised.qdrant.bootstrap}:6335";
|
|
};
|
|
};
|
|
}
|