mirror of
https://git.lgmrszd.xyz/Lgmrszd/nix-cfg.git
synced 2024-11-25 04:28:01 +01:00
vps1: enable postgres
This commit is contained in:
parent
e86e82d161
commit
1cc4297491
2 changed files with 29 additions and 0 deletions
|
@ -9,6 +9,7 @@ in
|
|||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./services/postgres.nix
|
||||
./akkotest.nix
|
||||
|
||||
(fetchTarball { url = "https://github.com/cariandrum22/nixos-vscode-server/tarball/support-for-new-dir-structure-of-vscode-server"; sha256 = "1sp4h0nb7dh7mcm8vdflihv76yz8azf5zifkcbxhq7xz48c8k5pd"; })
|
||||
|
|
28
hosts/vps1/services/postgres.nix
Normal file
28
hosts/vps1/services/postgres.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{pkgs, config, ...}: let
|
||||
cfg = config.services.postgresql;
|
||||
in {
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
package = pkgs.postgresql_16;
|
||||
enableJIT = true;
|
||||
settings = {
|
||||
max_connections = "200";
|
||||
shared_buffers = "2GB";
|
||||
effective_cache_size = "6GB";
|
||||
maintenance_work_mem = "512MB";
|
||||
checkpoint_completion_target = 0.9;
|
||||
wal_buffers = "16MB";
|
||||
default_statistics_target = 100;
|
||||
random_page_cost = 1.1;
|
||||
effective_io_concurrency = 200;
|
||||
work_mem = "5242kB";
|
||||
huge_pages = "off";
|
||||
min_wal_size = "1GB";
|
||||
max_wal_size = "4GB";
|
||||
max_worker_processes = 4;
|
||||
max_parallel_workers_per_gather = 2;
|
||||
max_parallel_workers = 4;
|
||||
max_parallel_maintenance_workers = 2;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue