chore: activate syncthing on several machines

This commit is contained in:
Luj 2025-01-25 16:49:42 +01:00
parent 9214bed77f
commit 5b249c58e5
Signed by: luj
GPG key ID: 6FC74C847011FD83
6 changed files with 120 additions and 6 deletions

View file

@ -10,6 +10,7 @@
imports = [
./hardware.nix
./home-julien.nix
./syncthing.nix
];
machine.meta = {
@ -26,7 +27,8 @@
networking.networkmanager.enable = true;
programs.ssh.knownHosts."epyc.infra.newtype.fr".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOXT9Init1MhKt4rjBANLq0t0bPww/WQZ96uB4AEDrml";
programs.ssh.knownHosts."epyc.infra.newtype.fr".publicKey =
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOXT9Init1MhKt4rjBANLq0t0bPww/WQZ96uB4AEDrml";
networking.networkmanager.dns = "systemd-resolved";
services.resolved.enable = true;

View file

@ -122,7 +122,6 @@
home.persistence."/persistent/home/julien" = {
files = [
".config/gnome-initial-setup-done"
".config/monitors.xml"
".config/background"
".cert/nm-openvpn/telecom-paris-ca.pem"
".local/share/com.ranfdev.Notify.sqlite"
@ -131,8 +130,8 @@
"Pictures"
"Documents"
".ssh"
"dev"
".mozilla"
"devold"
".config/cosmic"
".local/share/direnv"
".local/state/cosmic-comp"

View file

@ -0,0 +1,52 @@
{ config, ... }:
{
services.syncthing = {
enable = true;
user = "julien";
group = "users";
overrideDevices = true;
overrideFolders = true;
settings.options = {
urAccepted = -1;
listenAddresses = [ "tcp://${config.machine.meta.ips.vpn.ipv4}" ];
};
devices = {
"gustave" = {
id = "6APF3EP-TIV7ZBK-5WB5SA4-Y2K37CR-AMIB2TM-6T2VORK-UYNQO2X-TO6V2QH";
addresses = [
"tcp://gustave.luj:22000"
];
};
"fischer" = {
id = "PLIMD3Z-L4DYKDB-MY4PFTS-3RMQUNF-GFWFOBB-SELW6MB-WIQJ2LM-QAC45QQ";
addresses = [
"tcp://fischer.luj:22000"
];
};
};
folders = {
"dev" = {
path = "/home/julien/dev";
devices = [
"gustave"
"fischer"
];
};
};
};
systemd.services.syncthing.serviceConfig.StateDirectory = "syncthing";
systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true";
environment.persistence."/persistent".directories = [
{
directory = "/home/julien/dev";
user = "julien";
group = "users";
}
];
}