mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 16:21:34 +01:00
syncthing: set cert/key with sops
This commit is contained in:
parent
2da2cd592e
commit
8a0238af60
4 changed files with 29 additions and 12 deletions
|
|
@ -7,6 +7,8 @@
|
|||
let
|
||||
cfg = config.custom.services.syncthing;
|
||||
tailscaleCfg = config.custom.services.tailscale;
|
||||
|
||||
useStaticTls = config.custom.sops.secrets |> lib.hasAttr "syncthing";
|
||||
in
|
||||
{
|
||||
options.custom.services.syncthing = {
|
||||
|
|
@ -53,6 +55,11 @@ in
|
|||
];
|
||||
};
|
||||
|
||||
sops.secrets = lib.mkIf useStaticTls {
|
||||
"syncthing/cert".owner = config.services.syncthing.user;
|
||||
"syncthing/key".owner = config.services.syncthing.user;
|
||||
};
|
||||
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
|
||||
|
|
@ -62,6 +69,9 @@ in
|
|||
|
||||
guiAddress = lib.mkIf cfg.isServer "127.0.0.1:${toString cfg.gui.port}";
|
||||
|
||||
cert = lib.mkIf useStaticTls config.sops.secrets."syncthing/cert".path;
|
||||
key = lib.mkIf useStaticTls config.sops.secrets."syncthing/key".path;
|
||||
|
||||
settings = {
|
||||
# Get the devices and their ids from the configs of the other hosts
|
||||
devices =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue