This commit is contained in:
2023-03-08 18:00:18 +00:00
parent 56e5cde883
commit 9c82720103
18 changed files with 213 additions and 159 deletions

View File

@@ -1,9 +1,21 @@
{ lib, inputs, outputs, ... }:
{
{ inputs, lib, config, pkgs, ... }:
let
# cfg = config.modules.services.syncthing;
host = config.networking.hostName;
# Device IDs don't really need to be secret, but according to syncthing docs
# one can get the device IP if they know the device ID.
# devices = import ../../secrets/syncthing-devices.nix;
# FFS!! path concatenation in nix is a pain in the ass! see
# https://gist.github.com/CMCDragonkai/de84aece83f8521d087416fa21e34df4
# cert-text = builtins.readFile ("${config._secretstore}/hosts/" + "/${host}" + /syncthing/cert.pem);
# key-text = builtins.readFile ("${config._secretstore}/hosts/" + "/${host}" + /syncthing/key.pem);
in {
services.syncthing = {
enable = true;
dataDir = "/home/sstent";
# cert = "${pkgs.writeText "syncthing-cert.pem" cert-text}";
# key = "${pkgs.writeText "syncthing-key.pem" key-text}";
openDefaultPorts = true;
configDir = "/home/sstent/.config/syncthing";
user = "sstent";