mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-22 07:13:55 -05:00
nixos/syncthing: improve code readability
This commit is contained in:
parent
73672c4912
commit
12fc4b744f
|
@ -6,7 +6,10 @@
|
|||
}: {
|
||||
imports = [./syncMusic.nix];
|
||||
|
||||
config = lib.mkIf config.ar.services.syncthing.enable {
|
||||
config = let
|
||||
cfg = config.ar.services.syncthing;
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
age.secrets = {
|
||||
syncthingCert.file = ../../../secrets/syncthing + "/${config.networking.hostName}/cert.age";
|
||||
syncthingKey.file = ../../../secrets/syncthing + "/${config.networking.hostName}/key.age";
|
||||
|
@ -17,10 +20,10 @@
|
|||
services.syncthing = {
|
||||
enable = true;
|
||||
cert = config.age.secrets.syncthingCert.path;
|
||||
dataDir = "/home/${config.ar.services.syncthing.user}";
|
||||
dataDir = "/home/${cfg.user}";
|
||||
key = config.age.secrets.syncthingKey.path;
|
||||
openDefaultPorts = true;
|
||||
user = config.ar.services.syncthing.user;
|
||||
user = cfg.user;
|
||||
settings = {
|
||||
options = {
|
||||
localAnnounceEnabled = true;
|
||||
|
@ -43,7 +46,7 @@
|
|||
folders = {
|
||||
"sync" = {
|
||||
id = "default";
|
||||
path = "/home/${config.ar.services.syncthing.user}/sync";
|
||||
path = "/home/${cfg.user}/sync";
|
||||
devices = ["brawly" "fallarbor" "gsgmba" "iphone12" "lavaridge" "mauville" "petalburg" "rustboro" "mossdeep" "wallace" "winona"];
|
||||
versioning = {
|
||||
type = "staggered";
|
||||
|
@ -55,7 +58,7 @@
|
|||
};
|
||||
"camera" = {
|
||||
id = "fcsgh-dlxys";
|
||||
path = "/home/${config.ar.services.syncthing.user}/pics/camera";
|
||||
path = "/home/${cfg.user}/pics/camera";
|
||||
devices = ["brawly" "fallarbor" "lavaridge" "mauville" "petalburg" "rustboro" "wallace" "winona"];
|
||||
versioning = {
|
||||
params.cleanoutDays = "5";
|
||||
|
@ -64,7 +67,7 @@
|
|||
};
|
||||
"screenshots" = {
|
||||
id = "screenshots";
|
||||
path = "/home/${config.ar.services.syncthing.user}/pics/screenshots";
|
||||
path = "/home/${cfg.user}/pics/screenshots";
|
||||
devices = ["brawly" "fallarbor" "lavaridge" "mauville" "petalburg" "rustboro" "wallace" "winona"];
|
||||
versioning = {
|
||||
params.cleanoutDays = "5";
|
||||
|
|
Loading…
Reference in a new issue