[NixOS] More syncthing

This commit is contained in:
Ivan Malison 2023-08-03 22:01:56 -06:00
parent 37a415952d
commit 6f88c0ae28
2 changed files with 15 additions and 2 deletions

View File

@ -1,11 +1,18 @@
{ pkgs, ... }: { 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 = { services.syncthing = {
enable = true; enable = true;
settings = { settings = {
folders = { folders = {
sync = { sync = {
path = "~/"; path = "~/sync";
}; };
}; };
devices = { devices = {

View File

@ -1,7 +1,7 @@
{ pkgs, inputs, ... }: { pkgs, inputs, ... }:
{ {
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
users.extraUsers = let users.users = let
extraGroups = [ extraGroups = [
"audio" "audio"
"adbusers" "adbusers"
@ -10,6 +10,7 @@
"networkmanager" "networkmanager"
"openrazer" "openrazer"
"plugdev" "plugdev"
"syncthing"
"systemd-journal" "systemd-journal"
"video" "video"
"wheel" "wheel"
@ -35,6 +36,11 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO3tlMePru6ZlSuf8yUii3N1dy3WwJnSQAt3EgETkctK kat@jay-lenovo.local" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO3tlMePru6ZlSuf8yUii3N1dy3WwJnSQAt3EgETkctK kat@jay-lenovo.local"
]; ];
in { in {
syncthing = {
extraGroups = [ "syncthing" ];
home = "/var/lib/syncthing";
createHome = true;
};
imalison = userDefaults // { imalison = userDefaults // {
name = "imalison"; name = "imalison";
shell = pkgs.zsh; shell = pkgs.zsh;