diff options
-rw-r--r-- | hosts/laptop/cfg.nix | 1 | ||||
-rw-r--r-- | mixins/syncthing.nix | 38 |
2 files changed, 39 insertions, 0 deletions
diff --git a/hosts/laptop/cfg.nix b/hosts/laptop/cfg.nix index c624732..bd0f364 100644 --- a/hosts/laptop/cfg.nix +++ b/hosts/laptop/cfg.nix @@ -20,6 +20,7 @@ ../../mixins/pipewire.nix ../../mixins/multimedia.nix # ../../mixins/emacs + ../../mixins/syncthing.nix ]; config = { diff --git a/mixins/syncthing.nix b/mixins/syncthing.nix new file mode 100644 index 0000000..3e219ae --- /dev/null +++ b/mixins/syncthing.nix @@ -0,0 +1,38 @@ +{ + pkgs, + config, + ... +}: { + config = { + services.syncthing = { + enable = true; + user = "tzlil"; + dataDir = "/home/tzlil/sync"; + configDir = "/home/tzlil/.config/syncthing"; + overrideDevices = true; + overrideFolders = true; + devices = { + "phone" = {id = "UHWVTEZ-BERNFCH-3ZXQHNE-ZRBHLU6-MBAVEHB-TKLQJM7-ZGHLJ4R-6E4SAA7";}; + }; + folders = { + "passwords" = { + path = "/home/tzlil/sync/passwords"; + devices = ["phone"]; + }; + }; + }; + + environment.persistence."/nix/persist".directories = [ + { + directory = "/home/tzlil/sync"; + user = "tzlil"; + group = "users"; + } + { + directory = "/home/tzlil/.config/syncthing"; + user = "tzlil"; + group = "users"; + } + ]; + }; +} |