From 647f3af56a5c5e33ba235e5baf7c094afe801052 Mon Sep 17 00:00:00 2001 From: Mikael Voss Date: Tue, 12 Nov 2024 22:14:19 +0100 Subject: [PATCH] nixos/magi: Add CockroachDB configuration stub --- nixos/module/magi.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/nixos/module/magi.nix b/nixos/module/magi.nix index 77cffd5..f88c401 100644 --- a/nixos/module/magi.nix +++ b/nixos/module/magi.nix @@ -117,6 +117,22 @@ }; }; + services.cockroachdb = { + enable = true; + + listen.address = config.networking.fdqnOrHostname; + certsDir = ""; + + cache = ".05"; + maxSqlMemory = ".05"; + join = "casper.nyantec.com,melchior.nyantec.com,balthasar.nyantec.com"; + + extraArgs = [ + "--cluster-name=nyantec" + "--store=path=/var/lib/cockroachdb,attrs=ssd,size=.5" + ]; + }; + services.gobgpd = { enable = true; settings = { @@ -227,4 +243,11 @@ }; }; }; + + systemd.tmpfiles.rules = let + inherit (config.services) cockrochdb; + in [ + "q /var/lib/cockroachdb 0750 ${cockroachdb.user} ${cockroachdb.group} - -" + "H /var/lib/cockroachdb - - - - +C" + ]; }