feat: manage syncthing through NixOS instead

used to be done with home-manager
This commit is contained in:
Swarsel 2024-07-20 11:00:24 +02:00
parent b7d01eb50f
commit 07b0bf77db
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
5 changed files with 172 additions and 18 deletions

View file

@ -4912,7 +4912,8 @@ Some programs profit from being installed through dedicated NixOS settings on sy
};
#+end_src
Also, we setup zsh. Do not touch this.
**** zsh
Do not touch this.
#+begin_src nix :tangle profiles/common/nixos.nix
@ -4921,6 +4922,54 @@ Also, we setup zsh. Do not touch this.
environment.shells = with pkgs; [ zsh ];
environment.pathsToLink = [ "/share/zsh" ];
#+end_src
**** syncthing
#+begin_src nix :tangle profiles/common/nixos.nix
services.syncthing = {
enable = true;
user = "swarsel";
dataDir = "/home/swarsel";
configDir = "/home/swarsel/.config/syncthing";
openDefaultPorts = true;
settings = {
devices = {
"magicant" = {
id = "SEH2NMT-IVRQUU5-VPW2HUQ-3GQYDBF-F6H6OY6-X3DZTUZ-LCRE2DJ-QNIXIQ2";
};
"sync (@oracle)" = {
id = "ETW6TST-NPK7MKZ-M4LXMHA-QUPQHDT-VTSHH5X-CR5EIN2-YU7E55F-MGT7DQB";
};
"server1" = {
id = "ZXWVC4X-IIARITZ-MERZPHN-HD55Y6G-QJM2GTB-6BWYXMR-DTO3TS2-QDBREQQ";
};
};
folders = {
"Default Folder" = {
path = "/home/swarsel/Sync";
devices = [ "sync (@oracle)" "magicant" ];
id = "default";
};
"Obsidian" = {
path = "/home/swarsel/Nextcloud/Obsidian";
devices = [ "sync (@oracle)" "magicant" ];
id = "yjvni-9eaa7";
};
"Org" = {
path = "/home/swarsel/Nextcloud/Org";
devices = [ "sync (@oracle)" "magicant" ];
id = "a7xnl-zjj3d";
};
"Vpn" = {
path = "/home/swarsel/Vpn";
devices = [ "sync (@oracle)" "magicant" ];
id = "hgp9s-fyq3p";
};
};
};
};
#+end_src
*** Services
@ -6688,7 +6737,7 @@ Enables the syncthing service which talks to my syncthing instance on the Oracle
#+begin_src nix :tangle profiles/common/home.nix
services.syncthing = {
enable = true;
enable = false;
tray = {
enable = false; # we enable this by installing the syncthingtray package instead, it works better.
};