Common/syncthing: use key and cert from secrets

This commit is contained in:
Toast 2024-02-19 14:02:05 +01:00
parent 2f0230c401
commit 436c1785a8

View file

@ -1,7 +1,19 @@
{ config, ... }:
{ config, flakeSelf, ... }:
let
hostSecrets = "${flakeSelf.inputs.secrets}/" + config.networking.hostName;
in
{
# Get secrets
age.secrets = {
syncthingKey.file = hostSecrets + "/syncthingKey.age";
syncthingCert.file = hostSecrets + "/syncthingCert.age";
};
services.syncthing = {
key = config.age.secrets.syncthingKey.path;
cert = config.age.secrets.syncthingCert.path;
overrideDevices = true;
overrideFolders = true;
openDefaultPorts = true;