Change how syncthing is configured

Revert syncthing to using own user space in /var/lib/syncthing and set
to only run on server
User home-manager syncthing service (with tray) for other machines

Remove mpd/mpc, and spot
This commit is contained in:
Evie Litherland-Smith 2023-10-26 16:49:11 +01:00
parent 25628104a7
commit 461d2580dc
4 changed files with 31 additions and 22 deletions

View file

@ -45,8 +45,6 @@
group = "users"; group = "users";
shell = "zsh"; shell = "zsh";
systemModules = [ ./system/hyprland.nix ]; systemModules = [ ./system/hyprland.nix ];
serviceModules =
[ ./services/sshd/default.nix ./services/syncthing/default.nix ];
homeModules = [ homeModules = [
./home/accounts/default.nix ./home/accounts/default.nix
./home/emacs/default.nix ./home/emacs/default.nix
@ -58,14 +56,14 @@
./home/media.nix ./home/media.nix
./home/nnn.nix ./home/nnn.nix
./home/pass.nix ./home/pass.nix
./home/syncthing.nix
./home/zathura.nix ./home/zathura.nix
]; ];
stateVersion = "23.05"; stateVersion = "23.05";
}; };
systemConfig = { hostName ? default.hostName, user ? default.user systemConfig = { hostName ? default.hostName, user ? default.user
, system ? default.system, group ? default.group, shell ? default.shell , system ? default.system, group ? default.group, shell ? default.shell
, systemModules ? default.systemModules , systemModules ? default.systemModules, serviceModules ? [ ]
, serviceModules ? default.serviceModules
, homeModules ? default.homeModules, stateVersion ? default.stateVersion , homeModules ? default.homeModules, stateVersion ? default.stateVersion
}: }:
let let
@ -258,11 +256,13 @@
in systemConfig { in systemConfig {
inherit hostName user system; inherit hostName user system;
systemModules = [ ./system/default.nix ]; systemModules = [ ./system/default.nix ];
serviceModules = default.serviceModules ++ [ serviceModules = [
./services/adguardhome/default.nix ./services/adguardhome/default.nix
./services/gitea/default.nix ./services/gitea/default.nix
./services/nextcloud/default.nix ./services/nextcloud/default.nix
./services/ntfy-sh/default.nix ./services/ntfy-sh/default.nix
./services/sshd/default.nix
./services/syncthing/default.nix
]; ];
homeModules = homeModules =
[ ./home/default.nix ./home/media.nix ./home/emacs/default.nix ]; [ ./home/default.nix ./home/media.nix ./home/emacs/default.nix ];
@ -272,10 +272,7 @@
hostName = "Northstar"; hostName = "Northstar";
user = "xenia"; user = "xenia";
system = "x86_64-linux"; system = "x86_64-linux";
in systemConfig { in systemConfig { inherit hostName user system; };
inherit hostName user system;
systemModules = default.systemModules ++ [ ./system/steam.nix ];
};
Ronin = let Ronin = let
hostName = "Ronin"; hostName = "Ronin";

View file

@ -1,11 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
home.packages = with pkgs; [ mpc-cli spot ];
services.mpd = {
enable = true;
network.startWhenNeeded = true;
};
programs = { programs = {
mpv = { mpv = {
enable = true; enable = true;

8
home/syncthing.nix Normal file
View file

@ -0,0 +1,8 @@
{ config, lib, pkgs, ... }:
{
services.syncthing = {
enable = true;
tray.enable = true;
};
}

View file

@ -1,11 +1,8 @@
{ config, lib, pkgs, user, ... }: { config, lib, pkgs, user, ... }:
let devices = [ "Ion" "Legion" "Northstar" "Ronin" "Vanguard" ]; let devices = [ "Ion" "Legion" "Northstar" "Ronin" "Vanguard" ];
in { in {
services.syncthing = rec { services.syncthing = {
inherit user;
inherit (config.users.users.${user}) group;
enable = true; enable = true;
dataDir = "/home/${user}";
systemService = true; systemService = true;
openDefaultPorts = true; openDefaultPorts = true;
settings = { settings = {
@ -22,16 +19,28 @@ in {
"I366QNQ-D3FTDRX-RNOTXMW-YITZXOF-DSCDMQD-63Q72LI-ME2Y4HZ-T34RMQK"; "I366QNQ-D3FTDRX-RNOTXMW-YITZXOF-DSCDMQD-63Q72LI-ME2Y4HZ-T34RMQK";
}; };
folders = { folders = {
"Documents" = {
inherit devices;
id = "gvggx-6telk";
path = "~/Documents";
ignorePerms = true;
};
"Music" = {
inherit devices;
id = "munzw-vnxhl";
path = "~/Music";
ignorePerms = true;
};
"Pictures" = { "Pictures" = {
inherit devices; inherit devices;
id = "ziuj8-rm6dn"; id = "ziuj8-rm6dn";
path = "${dataDir}/Pictures"; path = "~/Pictures";
ignorePerms = true; ignorePerms = true;
}; };
"Zotero" = { "Videos" = {
inherit devices; inherit devices;
id = "huyvn-liwc9"; id = "mbsop-qteua";
path = "${dataDir}/Documents/Zotero"; path = "~/Videos";
ignorePerms = true; ignorePerms = true;
}; };
}; };