Back up Knot DNSSEC keystore from ns1 to control via borgbackup

clan borgbackup instance: control serves repos, ns1 backs up its
clan.core.state (the KASP keystore at /var/lib/knot) nightly over the
mesh with repokey encryption. ns1 maps the control machine name to its
ZeroTier address so the borg@control repo resolves.

Run `clan vars generate ns1` before deploy to mint the borg keypair.
This commit is contained in:
Berwn
2026-06-17 15:06:58 +07:00
parent 7ae3221b83
commit 044891927b
3 changed files with 38 additions and 4 deletions
+12 -1
View File
@@ -1,6 +1,7 @@
{ config, pkgs, ... }:
{ config, lib, pkgs, ... }:
let
domains = import ../../modules/dns/domains.nix;
mesh = import ../../modules/mesh-hosts.nix { inherit config lib; };
in
{
imports = [
@@ -11,6 +12,16 @@ in
clan.core.sops.defaultGroups = [ "admins" ];
# Knot's state dir holds the non-regenerable DNSSEC key material (KSK/ZSK
# private keys in the KASP keystore). Declaring it as clan state makes the
# borgbackup client back it up; losing it forces an emergency DS rollover at
# the registrar. mode 0700 owned by knot, but borg runs as root so it reads it.
clan.core.state.knot.folders = [ "/var/lib/knot" ];
# The borgbackup repo is addressed as `borg@control`; mesh peers have no name
# resolution, so map the control machine name to its ZeroTier mesh address.
networking.hosts.${mesh.hosts.control} = [ "control" ];
# Public IPv6 (matches the ns1 AAAA glue); SLAAC doesn't bring it up here.
cnx.staticIPv6 = {
enable = true;