summary refs log tree commit diff
path: root/host
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-05-07 17:33:35 +0200
committerRory& <root@rory.gay>2025-05-07 17:33:35 +0200
commit7cc9f2490cba971aab524e0c3ab29f69e5a3db97 (patch)
tree8b3224616e076700a19813e76ce2b974d0c6c874 /host
parentExpose vm variant during builds (diff)
downloadRory-Open-Architecture-7cc9f2490cba971aab524e0c3ab29f69e5a3db97.tar.xz
Support for vmvariant builds of Rory-ovh, part of synapse antispam, move to draupnir beta
Diffstat (limited to 'host')
-rwxr-xr-xhost/Rory-ovh/configuration.nix26
-rw-r--r--host/Rory-ovh/services/email/autoconfig.nix4
-rw-r--r--host/Rory-ovh/services/email/maddy.nix111
-rw-r--r--host/Rory-ovh/services/email/nginx.nix12
-rwxr-xr-xhost/Rory-ovh/services/matrix/synapse/synapse-main.nix70
-rwxr-xr-xhost/Rory-ovh/services/nginx/nginx.nix14
-rwxr-xr-xhost/Rory-ovh/services/nginx/rory.gay/cgit.nix5
-rwxr-xr-xhost/Rory-ovh/services/nginx/rory.gay/conduit.matrixunittests.nix5
-rwxr-xr-xhost/Rory-ovh/services/nginx/rory.gay/ec.nix6
-rwxr-xr-xhost/Rory-ovh/services/nginx/rory.gay/matrix-bak.nix5
-rwxr-xr-xhost/Rory-ovh/services/nginx/rory.gay/matrix.nix5
-rwxr-xr-xhost/Rory-ovh/services/nginx/rory.gay/matrixunittests.nix11
-rwxr-xr-xhost/Rory-ovh/services/nginx/rory.gay/mru.nix11
-rwxr-xr-xhost/Rory-ovh/services/nginx/rory.gay/root.nix5
-rwxr-xr-xhost/Rory-ovh/services/nginx/rory.gay/stream.nix5
-rwxr-xr-xhost/Rory-ovh/services/nginx/rory.gay/wad-api.nix2
-rwxr-xr-xhost/Rory-ovh/services/nginx/thearcanebrony.net/awooradio.nix3
-rwxr-xr-xhost/Rory-ovh/services/nginx/thearcanebrony.net/root.nix3
-rwxr-xr-xhost/Rory-ovh/services/nginx/thearcanebrony.net/search.nix3
-rwxr-xr-xhost/Rory-ovh/services/nginx/thearcanebrony.net/sentry.nix3
-rwxr-xr-xhost/Rory-ovh/services/postgres.nix10
21 files changed, 195 insertions, 124 deletions
diff --git a/host/Rory-ovh/configuration.nix b/host/Rory-ovh/configuration.nix

index 81a824d..f457603 100755 --- a/host/Rory-ovh/configuration.nix +++ b/host/Rory-ovh/configuration.nix
@@ -32,14 +32,14 @@ boot.loader.grub.devices = lib.mkForce [ "nodev" ]; networking = { hostName = "Rory-ovh"; - interfaces.enp98s0f0.ipv4.addresses = [ - { - address = "51.210.113.110"; - prefixLength = 24; - } - ]; - defaultGateway.interface = "enp98s0f0"; - defaultGateway.address = lib.mkForce "51.210.113.254"; + #interfaces.enp98s0f0.ipv4.addresses = [ + # { + # address = "51.210.113.110"; + # prefixLength = 24; + # } + #]; + #defaultGateway.interface = "enp98s0f0"; + #defaultGateway.address = "51.210.113.254"; nat = { enable = true; internalInterfaces = [ @@ -54,6 +54,16 @@ firewall.enable = lib.mkForce true; }; + systemd.network = { + enable = true; + networks.enp98s0f0 = { + name = "enp98s0f0"; + DHCP = "no"; + gateway = [ "51.210.113.254" ]; + address = [ "51.210.113.110" ]; + }; + }; + monitoring = { monitorAll = true; localPrometheus = true; diff --git a/host/Rory-ovh/services/email/autoconfig.nix b/host/Rory-ovh/services/email/autoconfig.nix
index d258046..5f3bce2 100644 --- a/host/Rory-ovh/services/email/autoconfig.nix +++ b/host/Rory-ovh/services/email/autoconfig.nix
@@ -1,7 +1,7 @@ -{ ... }: +{ config, ... }: { services.go-autoconfig = { - enable = true; + enable = !config.virtualisation.isVmVariant; settings = { service_addr = ":1323"; domain = "autoconfig.rory.gay"; diff --git a/host/Rory-ovh/services/email/maddy.nix b/host/Rory-ovh/services/email/maddy.nix
index 7dbf004..548cb1a 100644 --- a/host/Rory-ovh/services/email/maddy.nix +++ b/host/Rory-ovh/services/email/maddy.nix
@@ -1,68 +1,71 @@ { + lib, pkgs, options, config, ... }: { - services.maddy = { - enable = true; - primaryDomain = "rory.gay"; - hostname = "mail.rory.gay"; - ensureAccounts = [ - "root@rory.gay" - ]; - ensureCredentials = { - "root@rory.gay".passwordFile = "/var/lib/maddy/passwd/root"; - }; - config = builtins.readFile ./maddy.conf; - # builtins.replaceStrings - # [ - # "imap tcp://0.0.0.0:143" - # "submission tcp://0.0.0.0:587" - # "entry postmaster postmaster@$(primary_domain)" - # ] - # [ - # "imap tls://0.0.0.0:993 tcp://0.0.0.0:143" - # "submission tls://0.0.0.0:465 tcp://0.0.0.0:587" - # "entry postmaster root@$(primary_domain)" - # ] - # options.services.maddy.config.default; - - tls = { - loader = "file"; - certificates = [ - { -# certPath = "/var/lib/acme/mail.rory.gay/fullchain.pem"; -# keyPath = "/var/lib/acme/mail.rory.gay/key.pem"; - certPath = "/run/credentials/maddy.service/acme-fullchain.pem"; - keyPath = "/run/credentials/maddy.service/acme-key.pem"; - } + config = lib.mkIf (!config.virtualisation.isVmVariant) { + services.maddy = { + enable = true; + primaryDomain = "rory.gay"; + hostname = "mail.rory.gay"; + ensureAccounts = [ + "root@rory.gay" ]; + ensureCredentials = { + "root@rory.gay".passwordFile = "/var/lib/maddy/passwd/root"; + }; + config = builtins.readFile ./maddy.conf; + # builtins.replaceStrings + # [ + # "imap tcp://0.0.0.0:143" + # "submission tcp://0.0.0.0:587" + # "entry postmaster postmaster@$(primary_domain)" + # ] + # [ + # "imap tls://0.0.0.0:993 tcp://0.0.0.0:143" + # "submission tls://0.0.0.0:465 tcp://0.0.0.0:587" + # "entry postmaster root@$(primary_domain)" + # ] + # options.services.maddy.config.default; + + tls = { + loader = "file"; + certificates = [ + { + # certPath = "/var/lib/acme/mail.rory.gay/fullchain.pem"; + # keyPath = "/var/lib/acme/mail.rory.gay/key.pem"; + certPath = "/run/credentials/maddy.service/acme-fullchain.pem"; + keyPath = "/run/credentials/maddy.service/acme-key.pem"; + } + ]; + }; }; - }; - networking.firewall.allowedTCPPorts = [ - 25 - 143 - 465 - 587 - 993 - ]; + networking.firewall.allowedTCPPorts = [ + 25 + 143 + 465 + 587 + 993 + ]; - users.users.maddy.extraGroups = [ "nginx" ]; + users.users.maddy.extraGroups = [ "nginx" ]; - fileSystems."/var/lib/maddy" = { - depends = [ "/" ]; - device = "/data/maddy"; - fsType = "none"; - options = [ "bind" ]; - }; - - systemd.services.maddy.serviceConfig = { - LoadCredential = [ - "acme-fullchain.pem:/var/lib/acme/rory.gay/fullchain.pem" - "acme-key.pem:/var/lib/acme/rory.gay/key.pem" - ]; + fileSystems."/var/lib/maddy" = { + depends = [ "/" ]; + device = "/data/maddy"; + fsType = "none"; + options = [ "bind" ]; + }; + + systemd.services.maddy.serviceConfig = { + LoadCredential = [ + "acme-fullchain.pem:/var/lib/acme/rory.gay/fullchain.pem" + "acme-key.pem:/var/lib/acme/rory.gay/key.pem" + ]; + }; }; } diff --git a/host/Rory-ovh/services/email/nginx.nix b/host/Rory-ovh/services/email/nginx.nix
index 812993a..5b04612 100644 --- a/host/Rory-ovh/services/email/nginx.nix +++ b/host/Rory-ovh/services/email/nginx.nix
@@ -2,8 +2,8 @@ { services.nginx.virtualHosts = { "mta-sts.rory.gay" = { - enableACME = true; - forceSSL = true; + enableACME = !config.virtualisation.isVmVariant; + forceSSL = !config.virtualisation.isVmVariant; locations = { "/.well-known/mta-sts.txt" = { # age 604800 @@ -17,15 +17,15 @@ }; }; "mail.rory.gay" = { - enableACME = true; - forceSSL = true; + enableACME = !config.virtualisation.isVmVariant; + forceSSL = !config.virtualisation.isVmVariant; locations = { "/".return = "200 'OK'"; }; }; "autoconfig.rory.gay" = { - enableACME = true; - forceSSL = true; + enableACME = !config.virtualisation.isVmVariant; + forceSSL = !config.virtualisation.isVmVariant; locations."/".proxyPass = "http://localhost:1323"; }; }; diff --git a/host/Rory-ovh/services/matrix/synapse/synapse-main.nix b/host/Rory-ovh/services/matrix/synapse/synapse-main.nix
index c6e5217..f4ca044 100755 --- a/host/Rory-ovh/services/matrix/synapse/synapse-main.nix +++ b/host/Rory-ovh/services/matrix/synapse/synapse-main.nix
@@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ config, pkgs, ... }: { # Worker plumbing examples: https://github.com/element-hq/synapse/blob/master/docker/configure_workers_and_start.py @@ -11,21 +11,21 @@ nginxVirtualHostName = "matrix.rory.gay"; enableWorkers = true; - federationSenders = 16; # 16 - pushers = 1; - mediaRepoWorkers = 2; # 4 - clientReaders = 2; # 4 - syncWorkers = 2; # 4 + federationSenders = if config.virtualisation.isVmVariant then 0 else 16; # 16 + pushers = if config.virtualisation.isVmVariant then 1 else 1; + mediaRepoWorkers = if config.virtualisation.isVmVariant then 1 else 2; # 4 + clientReaders = if config.virtualisation.isVmVariant then 2 else 2; # 4 + syncWorkers = if config.virtualisation.isVmVariant then 2 else 2; # 4 #authWorkers = 0; - eventCreators = 16; + eventCreators = if config.virtualisation.isVmVariant then 2 else 16; - federationReaders = 8; # 8 - federationInboundWorkers = 16; # 8 + federationReaders = if config.virtualisation.isVmVariant then 0 else 8; # 8 + federationInboundWorkers = if config.virtualisation.isVmVariant then 0 else 16; # 8 - enableAppserviceWorker = true; - enableBackgroundWorker = true; - enableUserDirWorker = true; + enableAppserviceWorker = if config.virtualisation.isVmVariant then true else true; + enableBackgroundWorker = if config.virtualisation.isVmVariant then true else true; + enableUserDirWorker = if config.virtualisation.isVmVariant then true else true; accountDataStreamWriters = 1; eventStreamWriters = 2; # 8 @@ -35,6 +35,10 @@ toDeviceStreamWriters = 1; typingStreamWriters = 1; + plugins = with pkgs.matrix-synapse-plugins; [ + synapse-http-antispam + ]; + #untested: #sharedStreamWriters = 1; @@ -223,4 +227,46 @@ }; systemd.tmpfiles.rules = [ "D /run/redis-matrix-synapse 0755 matrix-synapse matrix-synapse" ]; + + virtualisation.vmVariant = { + systemd.tmpfiles.rules = [ "D /run/secrets 0755 nobody nobody" ]; + systemd.services."matrix-synapse-generate-token" = { + # generate /data/secrets/synapse-shared-secret + description = "Generate Synapse shared secret"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + before = [ "matrix-synapse.service" ]; + script = '' + set -e -x -o pipefail + echo "Starting key generation" + if [ ! -f "/data/secrets/synapse-shared-secret" ] + then + echo "Generating new key" + ${pkgs.openssl}/bin/openssl rand -base64 32 > /data/secrets/synapse-shared-secret + echo "Key generation complete" + else + echo "Not generating key, key exists" + fi + echo "Script complete" + ''; + }; + systemd.services."matrix-synapse-postgres-init" = { + description = "Generate synapse postgres user"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" "postgresql.service" ]; + before = [ "matrix-synapse.service" ]; + + script = '' + set -e -x -o pipefail + ${pkgs.postgresql}/bin/createuser ${config.services.matrix-synapse.settings.database.args.user} || true + ${pkgs.postgresql}/bin/createdb --encoding=UTF8 --locale=C --template=template0 --owner=${config.services.matrix-synapse.settings.database.args.user} ${config.services.matrix-synapse.settings.database.args.database} || true + ''; + serviceConfig = { + User = "postgres"; + Group = "postgres"; + WorkingDirectory = config.services.postgresql.dataDir; + RemainAfterExit = true; + }; + }; + }; } diff --git a/host/Rory-ovh/services/nginx/nginx.nix b/host/Rory-ovh/services/nginx/nginx.nix
index 3b58796..453816f 100755 --- a/host/Rory-ovh/services/nginx/nginx.nix +++ b/host/Rory-ovh/services/nginx/nginx.nix
@@ -1,7 +1,7 @@ { config, pkgs, ... }: let serveDir = config: { - enableACME = if config ? ssl then config.ssl else true; + enableACME = if config ? ssl then config.ssl else !config.virtualisation.isVmVariant; addSSL = if config ? ssl then config.ssl else true; root = if config ? path then config.path else builtins.throw "path is required"; locations = { @@ -60,22 +60,22 @@ in # "sentry.thearcanebrony.net" = import ./thearcanebrony.net/sentry.nix; # "search.thearcanebrony.net" = import ./thearcanebrony.net/search.nix; # - "rory.gay" = import ./rory.gay/root.nix; + "rory.gay" = import ./rory.gay/root.nix { inherit config; }; # "lfs.rory.gay" = serveDir { path = "/data/nginx/html_lfs"; }; # # "awooradio.thearcanebrony.net" = import ./thearcanebrony.net/awooradio.nix; - "cgit.rory.gay" = import ./rory.gay/cgit.nix; + "cgit.rory.gay" = import ./rory.gay/cgit.nix { inherit config; }; # #"jitsi.rory.gay" = import ./rory.gay/jitsi.nix; # # #matrix... # "conduit.rory.gay" = import ./rory.gay/conduit.nix; - "matrix.rory.gay" = import ./rory.gay/matrix.nix; - "stream.rory.gay" = import ./rory.gay/stream.nix; + "matrix.rory.gay" = import ./rory.gay/matrix.nix { inherit config; }; + "stream.rory.gay" = import ./rory.gay/stream.nix { inherit config; }; # "pcpoc.rory.gay" = import ./rory.gay/pcpoc.nix; # "matrixunittests.rory.gay" = import ./rory.gay/matrixunittests.nix; # "conduit.matrixunittests.rory.gay" = import ./rory.gay/conduit.matrixunittests.nix; - "mru.rory.gay" = import ./rory.gay/mru.nix; - "ec.rory.gay" = import ./rory.gay/ec.nix; + "mru.rory.gay" = import ./rory.gay/mru.nix { inherit config; }; + "ec.rory.gay" = import ./rory.gay/ec.nix { inherit config; }; }; }; }; diff --git a/host/Rory-ovh/services/nginx/rory.gay/cgit.nix b/host/Rory-ovh/services/nginx/rory.gay/cgit.nix
index 35fc85b..7b49a42 100755 --- a/host/Rory-ovh/services/nginx/rory.gay/cgit.nix +++ b/host/Rory-ovh/services/nginx/rory.gay/cgit.nix
@@ -1,7 +1,8 @@ +{ config }: { + enableACME = !config.virtualisation.isVmVariant; + addSSL = !config.virtualisation.isVmVariant; root = "/data/git"; - enableACME = true; - addSSL = true; extraConfig = '' autoindex on; more_set_headers 'Access-Control-Allow-Origin: *'; diff --git a/host/Rory-ovh/services/nginx/rory.gay/conduit.matrixunittests.nix b/host/Rory-ovh/services/nginx/rory.gay/conduit.matrixunittests.nix
index 9503747..231d5e3 100755 --- a/host/Rory-ovh/services/nginx/rory.gay/conduit.matrixunittests.nix +++ b/host/Rory-ovh/services/nginx/rory.gay/conduit.matrixunittests.nix
@@ -1,6 +1,7 @@ +{ config }: { - enableACME = true; - addSSL = true; + enableACME = !config.virtualisation.isVmVariant; + addSSL = !config.virtualisation.isVmVariant; http3 = true; http3_hq = true; kTLS = true; diff --git a/host/Rory-ovh/services/nginx/rory.gay/ec.nix b/host/Rory-ovh/services/nginx/rory.gay/ec.nix
index 0985503..c50b1f9 100755 --- a/host/Rory-ovh/services/nginx/rory.gay/ec.nix +++ b/host/Rory-ovh/services/nginx/rory.gay/ec.nix
@@ -1,7 +1,7 @@ +{ config }: { - enableACME = true; - addSSL = true; - kTLS = true; + enableACME = !config.virtualisation.isVmVariant; + addSSL = !config.virtualisation.isVmVariant; root = "/data/nginx/html_ec"; reuseport = true; extraConfig = '' diff --git a/host/Rory-ovh/services/nginx/rory.gay/matrix-bak.nix b/host/Rory-ovh/services/nginx/rory.gay/matrix-bak.nix
index 5d44454..1af3669 100755 --- a/host/Rory-ovh/services/nginx/rory.gay/matrix-bak.nix +++ b/host/Rory-ovh/services/nginx/rory.gay/matrix-bak.nix
@@ -1,6 +1,7 @@ +{ config }: { - enableACME = true; - addSSL = true; + enableACME = !config.virtualisation.isVmVariant; + addSSL = !config.virtualisation.isVmVariant; locations."/_matrix" = { proxyPass = "http://192.168.1.5:8008"; extraConfig = '' diff --git a/host/Rory-ovh/services/nginx/rory.gay/matrix.nix b/host/Rory-ovh/services/nginx/rory.gay/matrix.nix
index d48f4ca..45a507f 100755 --- a/host/Rory-ovh/services/nginx/rory.gay/matrix.nix +++ b/host/Rory-ovh/services/nginx/rory.gay/matrix.nix
@@ -1,6 +1,7 @@ +{ config }: { - enableACME = true; - addSSL = true; + enableACME = !config.virtualisation.isVmVariant; + addSSL = !config.virtualisation.isVmVariant; locations."/" = { #proxyPass = "http://127.0.0.1:9001"; proxyPass = "http://localhost:8008"; diff --git a/host/Rory-ovh/services/nginx/rory.gay/matrixunittests.nix b/host/Rory-ovh/services/nginx/rory.gay/matrixunittests.nix
index edb1704..f23f0dd 100755 --- a/host/Rory-ovh/services/nginx/rory.gay/matrixunittests.nix +++ b/host/Rory-ovh/services/nginx/rory.gay/matrixunittests.nix
@@ -1,9 +1,10 @@ +{ config }: { - enableACME = true; - addSSL = true; - http3 = true; - http3_hq = true; - kTLS = true; + enableACME = !config.virtualisation.isVmVariant; + addSSL = !config.virtualisation.isVmVariant; + http3 = !config.virtualisation.isVmVariant; + http3_hq = !config.virtualisation.isVmVariant; + kTLS = !config.virtualisation.isVmVariant; extraConfig = '' brotli off; ''; diff --git a/host/Rory-ovh/services/nginx/rory.gay/mru.nix b/host/Rory-ovh/services/nginx/rory.gay/mru.nix
index d1e1cd7..6e685de 100755 --- a/host/Rory-ovh/services/nginx/rory.gay/mru.nix +++ b/host/Rory-ovh/services/nginx/rory.gay/mru.nix
@@ -1,10 +1,11 @@ +{ config }: { - enableACME = true; - addSSL = true; + enableACME = !config.virtualisation.isVmVariant; + addSSL = !config.virtualisation.isVmVariant; # quic = true; - http3 = true; - http3_hq = true; - kTLS = true; + http3 = !config.virtualisation.isVmVariant; + http3_hq = !config.virtualisation.isVmVariant; + kTLS = !config.virtualisation.isVmVariant; root = "/data/nginx/html_mru"; # reuseport = true; extraConfig = '' diff --git a/host/Rory-ovh/services/nginx/rory.gay/root.nix b/host/Rory-ovh/services/nginx/rory.gay/root.nix
index 11d06c0..a7720ec 100755 --- a/host/Rory-ovh/services/nginx/rory.gay/root.nix +++ b/host/Rory-ovh/services/nginx/rory.gay/root.nix
@@ -1,7 +1,8 @@ +{ config }: { + enableACME = !config.virtualisation.isVmVariant; + addSSL = !config.virtualisation.isVmVariant; root = "/data/nginx/html_rory_gay"; - enableACME = true; - addSSL = true; extraConfig = ''autoindex on;''; locations."= /.well-known/matrix/server".extraConfig = '' diff --git a/host/Rory-ovh/services/nginx/rory.gay/stream.nix b/host/Rory-ovh/services/nginx/rory.gay/stream.nix
index f382cc9..caed22f 100755 --- a/host/Rory-ovh/services/nginx/rory.gay/stream.nix +++ b/host/Rory-ovh/services/nginx/rory.gay/stream.nix
@@ -1,6 +1,7 @@ +{ config }: { - enableACME = true; - addSSL = true; + enableACME = !config.virtualisation.isVmVariant; + addSSL = !config.virtualisation.isVmVariant; locations = { "/" = { proxyPass = "http://localhost:1934"; diff --git a/host/Rory-ovh/services/nginx/rory.gay/wad-api.nix b/host/Rory-ovh/services/nginx/rory.gay/wad-api.nix
index 65e9bdb..ac07547 100755 --- a/host/Rory-ovh/services/nginx/rory.gay/wad-api.nix +++ b/host/Rory-ovh/services/nginx/rory.gay/wad-api.nix
@@ -1,5 +1,5 @@ { - enableACME = true; + enableACME = !config.virtualisation.isVmVariant; addSSL = true; locations = { "/" = { diff --git a/host/Rory-ovh/services/nginx/thearcanebrony.net/awooradio.nix b/host/Rory-ovh/services/nginx/thearcanebrony.net/awooradio.nix
index f13cb0c..c0ca8b0 100755 --- a/host/Rory-ovh/services/nginx/thearcanebrony.net/awooradio.nix +++ b/host/Rory-ovh/services/nginx/thearcanebrony.net/awooradio.nix
@@ -1,5 +1,6 @@ +{ config }: { - enableACME = true; + enableACME = !config.virtualisation.isVmVariant; addSSL = true; locations = { "/" = { diff --git a/host/Rory-ovh/services/nginx/thearcanebrony.net/root.nix b/host/Rory-ovh/services/nginx/thearcanebrony.net/root.nix
index 86dddac..59cba43 100755 --- a/host/Rory-ovh/services/nginx/thearcanebrony.net/root.nix +++ b/host/Rory-ovh/services/nginx/thearcanebrony.net/root.nix
@@ -1,5 +1,6 @@ +{ config }: { - enableACME = true; + enableACME = !config.virtualisation.isVmVariant; addSSL = true; root = "/data/nginx/html_thearcanebrony"; extraConfig = ''autoindex on;''; diff --git a/host/Rory-ovh/services/nginx/thearcanebrony.net/search.nix b/host/Rory-ovh/services/nginx/thearcanebrony.net/search.nix
index cd655d8..cfb4e1c 100755 --- a/host/Rory-ovh/services/nginx/thearcanebrony.net/search.nix +++ b/host/Rory-ovh/services/nginx/thearcanebrony.net/search.nix
@@ -1,5 +1,6 @@ +{ config }: { - enableACME = true; + enableACME = !config.virtualisation.isVmVariant; addSSL = true; locations = { "/" = { diff --git a/host/Rory-ovh/services/nginx/thearcanebrony.net/sentry.nix b/host/Rory-ovh/services/nginx/thearcanebrony.net/sentry.nix
index f496190..8cd0826 100755 --- a/host/Rory-ovh/services/nginx/thearcanebrony.net/sentry.nix +++ b/host/Rory-ovh/services/nginx/thearcanebrony.net/sentry.nix
@@ -1,5 +1,6 @@ +{ config }: { - enableACME = true; + enableACME = !config.virtualisation.isVmVariant; addSSL = true; locations = { "/" = { diff --git a/host/Rory-ovh/services/postgres.nix b/host/Rory-ovh/services/postgres.nix
index 50dffa1..10d1cb7 100755 --- a/host/Rory-ovh/services/postgres.nix +++ b/host/Rory-ovh/services/postgres.nix
@@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ config, pkgs, ... }: { systemd.tmpfiles.rules = [ "d /data/dedicated/postgres 0750 postgres postgres" ]; @@ -27,11 +27,11 @@ max_connections = 2500; superuser_reserved_connections = 3; - shared_buffers = "64GB"; - work_mem = "32GB"; - maintenance_work_mem = "8GB"; + shared_buffers = if config.virtualisation.isVmVariant then "128MB" else "64GB"; + work_mem = if config.virtualisation.isVmVariant then "64MB" else "32GB"; + maintenance_work_mem = if config.virtualisation.isVmVariant then "512MB" else "8GB"; huge_pages = "try"; - effective_cache_size = "64GB"; # was 22 + effective_cache_size = if config.virtualisation.isVmVariant then "1GB" else "64GB"; # was 22 effective_io_concurrency = 100; random_page_cost = 1.1;