From 6f88c0ae286f500a803b09dc2b903a35586f48fb Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 3 Aug 2023 22:01:56 -0600 Subject: [PATCH] [NixOS] More syncthing --- nixos/syncthing.nix | 9 ++++++++- nixos/users.nix | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/nixos/syncthing.nix b/nixos/syncthing.nix index f9139f50..f9b5512e 100644 --- a/nixos/syncthing.nix +++ b/nixos/syncthing.nix @@ -1,11 +1,18 @@ { pkgs, ... }: { + system.activationScripts.syncthingPermissions = { + text = '' + chown -R syncthing:syncthing /var/lib/syncthing + chmod -R 2770 /var/lib/syncthing + mkdir -p /var/lib/syncthing/sync + ''; + }; services.syncthing = { enable = true; settings = { folders = { sync = { - path = "~/"; + path = "~/sync"; }; }; devices = { diff --git a/nixos/users.nix b/nixos/users.nix index da3c9dd4..4e85b8d4 100644 --- a/nixos/users.nix +++ b/nixos/users.nix @@ -1,7 +1,7 @@ { pkgs, inputs, ... }: { security.sudo.wheelNeedsPassword = false; - users.extraUsers = let + users.users = let extraGroups = [ "audio" "adbusers" @@ -10,6 +10,7 @@ "networkmanager" "openrazer" "plugdev" + "syncthing" "systemd-journal" "video" "wheel" @@ -35,6 +36,11 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO3tlMePru6ZlSuf8yUii3N1dy3WwJnSQAt3EgETkctK kat@jay-lenovo.local" ]; in { + syncthing = { + extraGroups = [ "syncthing" ]; + home = "/var/lib/syncthing"; + createHome = true; + }; imalison = userDefaults // { name = "imalison"; shell = pkgs.zsh;