plugin options
This commit is contained in:
parent
428be2c33d
commit
522124e8c7
1 changed files with 43 additions and 5 deletions
42
flake.nix
42
flake.nix
|
@ -123,6 +123,37 @@
|
|||
};
|
||||
default = {};
|
||||
};
|
||||
plugins = lib.options.mkOption {
|
||||
type = lib.types.submodule {
|
||||
options = {
|
||||
pgvecto-rs = lib.options.mkOption {
|
||||
type = lib.types.submodule {
|
||||
options = {
|
||||
enable = lib.options.mkOption {
|
||||
description = "Enable pgvecto.rs plugin";
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
default = {};
|
||||
};
|
||||
postgis = lib.options.mkOption {
|
||||
type = lib.types.submodule {
|
||||
options = {
|
||||
enable = lib.options.mkOption {
|
||||
description = "Enable postgis plugin";
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
default = {};
|
||||
};
|
||||
replication = lib.options.mkOption {
|
||||
type = lib.types.submodule {
|
||||
options = {
|
||||
|
@ -366,10 +397,17 @@
|
|||
escapeShell = value: lib.replaceStrings ["$"] ["\\$"] value;
|
||||
|
||||
postgresql = pkgs.postgresql_15.withPackages (
|
||||
plugins: [
|
||||
plugins:
|
||||
(
|
||||
lib.optionals cfg.plugins.postgis.enable [
|
||||
plugins.postgis
|
||||
]
|
||||
)
|
||||
++ (
|
||||
lib.optionals cfg.plugins.pgvecto-rs.enable [
|
||||
self.packages.${pkgs.system}.pgvecto-rs
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
# rcloneConfig = pkgs.writeTextFile {
|
||||
|
@ -633,7 +671,7 @@
|
|||
password_encryption = "scram-sha-256";
|
||||
port = cfg.port;
|
||||
shared_buffers = "128MB";
|
||||
shared_preload_libraries = "\"vectors.so\"";
|
||||
shared_preload_libraries = lib.strings.concatStringsSep "," (lib.optionals cfg.plugins.pgvecto-rs.enable ["vectors.so"]);
|
||||
ssl = "on";
|
||||
ssl_cert_file = "/run/credentials/postgresql.service/fullchain.pem";
|
||||
ssl_key_file = "/run/credentials/postgresql.service/key.pem";
|
||||
|
|
Loading…
Reference in a new issue