Syncthing: move common devices and folders into common role

This commit is contained in:
Toast 2023-08-31 21:25:15 +02:00
parent a0b5740029
commit b02aef6546
3 changed files with 29 additions and 18 deletions

View file

@ -4,5 +4,6 @@
imports = [ imports = [
./avahi.nix ./avahi.nix
./tailscale.nix ./tailscale.nix
./syncthing.nix
]; ];
} }

View file

@ -0,0 +1,28 @@
{ config, ... }:
{
# Set up devices and folders common to every device
services.syncthing = {
devices = {
"phone" = {
name = "Xiaomi Redmi Note 10 Pro";
id = "K7KNZ5V-XREUADL-CROQXPV-6AA4H65-2VUD34Z-VQWKJ6S-LWWW4EE-XPNEZQ6";
};
"pc" = {
name = "Archie";
id = "NJPX754-64AQNP3-7GZFIRZ-W2EDRJQ-27ORWYM-X5YXEXQ-ERRTRTQ-BSYD4AY";
};
"steamdeck" = {
name = "Steam Deck";
id = "DLQPL74-KEQTPM5-X4PDZHB-4HLQYHV-UCMJLOB-P6W3KWU-QLJADBY-V4KEMA5";
};
};
folders = {
"passwords" = {
label = "KeePassXC Passwords";
id = "rdyaq-ex659";
devices = [ "phone" "pc" "steamdeck"];
};
};
};
}

View file

@ -10,27 +10,9 @@
key = config.age.secrets.syncthingKey.path; key = config.age.secrets.syncthingKey.path;
cert = config.age.secrets.syncthingCert.path; cert = config.age.secrets.syncthingCert.path;
guiAddress = "0.0.0.0:8384"; guiAddress = "0.0.0.0:8384";
devices = {
"phone" = {
id = "K7KNZ5V-XREUADL-CROQXPV-6AA4H65-2VUD34Z-VQWKJ6S-LWWW4EE-XPNEZQ6";
name = "Xiaomi Redmi Note 10 Pro";
};
"pc" = {
name = "Archie";
id = "NJPX754-64AQNP3-7GZFIRZ-W2EDRJQ-27ORWYM-X5YXEXQ-ERRTRTQ-BSYD4AY";
addresses = [ "tcp://archie.local:22000" "tcp://192.168.0.161:22000"];
};
"steamdeck" = {
name = "Steam Deck";
id = "DLQPL74-KEQTPM5-X4PDZHB-4HLQYHV-UCMJLOB-P6W3KWU-QLJADBY-V4KEMA5";
};
};
folders = { folders = {
"passwords" = { "passwords" = {
label = "KeePassXC Passwords";
id = "rdyaq-ex659";
path = "${config.services.syncthing.dataDir}/passwords"; path = "${config.services.syncthing.dataDir}/passwords";
devices = [ "phone" "pc" "steamdeck"];
}; };
}; };
}; };