feat: init

This commit is contained in:
Nick 2024-10-06 15:25:05 -05:00
commit c19ea940bd
320 changed files with 23845 additions and 0 deletions

54
nixos/modules/syncthing.nix Executable file
View file

@ -0,0 +1,54 @@
{flake, ...}: let
inherit (flake.config.system.device) nas phone tablet wildcard;
inherit (flake.config.service.instance.syncthing) ports;
localhost = wildcard.ip.address0;
in {
services = {
syncthing = {
enable = true;
overrideDevices = false;
overrideFolders = false;
openDefaultPorts = true;
systemService = true;
guiAddress = "${localhost}:${toString ports.port0}";
settings = {
devices = {
${nas.name} = {
autoAcceptFolders = true;
name = nas.name;
addresses = [
"tcp://${nas.ip.address0}:${toString ports.port2}"
];
id = nas.sync;
};
${phone.name} = {
autoAcceptFolders = true;
name = phone.name;
addresses = [
"tcp://${phone.ip.address0}:${toString ports.port2}"
];
id = phone.sync;
};
${tablet.name} = {
autoAcceptFolders = true;
name = tablet.name;
addresses = [
"tcp://${tablet.ip.address0}:${toString ports.port2}"
];
id = tablet.sync;
};
};
};
};
};
networking = {
firewall = {
allowedTCPPorts = [
ports.port0
ports.port1
ports.port2
];
};
};
}