nixos/syncthing: integrate cfg one file

This commit is contained in:
Aly Raffauf 2024-07-08 00:39:51 -04:00
parent 41852c9d1f
commit 08f91eaad6
2 changed files with 40 additions and 50 deletions

View file

@ -4,8 +4,6 @@
pkgs, pkgs,
... ...
}: { }: {
imports = [./syncMusic.nix];
config = let config = let
cfg = config.ar.services.syncthing; cfg = config.ar.services.syncthing;
in in
@ -30,6 +28,7 @@
relaysEnabled = true; relaysEnabled = true;
urAccepted = -1; urAccepted = -1;
}; };
devices = { devices = {
"brawly" = {id = "BBIBWMR-CN4CFC4-2XMPLII-XFWXBT5-EPCZCAF-JOWAX5J-DHIGNM4-O3XQ4Q3";}; # Pixel 6a "brawly" = {id = "BBIBWMR-CN4CFC4-2XMPLII-XFWXBT5-EPCZCAF-JOWAX5J-DHIGNM4-O3XQ4Q3";}; # Pixel 6a
"fallarbor" = {id = "P4URLH4-YWLMO6J-W62ET7H-TQAO3Y6-T2FAYOY-C2VTI65-VQXHVGG-NQ76PAZ";}; # Framework 13 Intel 11th gen "fallarbor" = {id = "P4URLH4-YWLMO6J-W62ET7H-TQAO3Y6-T2FAYOY-C2VTI65-VQXHVGG-NQ76PAZ";}; # Framework 13 Intel 11th gen
@ -43,7 +42,9 @@
"wallace" = {id = "X55NQL2-H3TEJ5U-EXZPBKQ-LI6BMB4-W2ULDIJ-YNIHJHB-4ISCOJB-UHNLYAX";}; # Samsung a35 "wallace" = {id = "X55NQL2-H3TEJ5U-EXZPBKQ-LI6BMB4-W2ULDIJ-YNIHJHB-4ISCOJB-UHNLYAX";}; # Samsung a35
"winona" = {id = "IGAW5SS-WY2QN6J-5TF74YZ-6XPNPTC-RCH3HIT-ZZQKCAI-6L54IS2-SNRIMA2";}; # Pixel Tablet "winona" = {id = "IGAW5SS-WY2QN6J-5TF74YZ-6XPNPTC-RCH3HIT-ZZQKCAI-6L54IS2-SNRIMA2";}; # Pixel Tablet
}; };
folders = {
folders =
{
"sync" = { "sync" = {
id = "default"; id = "default";
path = "/home/${cfg.user}/sync"; path = "/home/${cfg.user}/sync";
@ -56,6 +57,7 @@
}; };
}; };
}; };
"camera" = { "camera" = {
id = "fcsgh-dlxys"; id = "fcsgh-dlxys";
path = "/home/${cfg.user}/pics/camera"; path = "/home/${cfg.user}/pics/camera";
@ -65,6 +67,7 @@
type = "trashcan"; type = "trashcan";
}; };
}; };
"screenshots" = { "screenshots" = {
id = "screenshots"; id = "screenshots";
path = "/home/${cfg.user}/pics/screenshots"; path = "/home/${cfg.user}/pics/screenshots";
@ -74,6 +77,13 @@
type = "trashcan"; type = "trashcan";
}; };
}; };
}
// lib.attrsets.optionalAttrs (config.ar.services.syncthing.syncMusic) {
"music" = {
id = "6nzmu-z9der";
path = config.ar.services.syncthing.musicPath;
devices = ["lavaridge" "mauville" "petalburg" "rustboro" "wallace"];
};
}; };
}; };
}; };

View file

@ -1,20 +0,0 @@
{
pkgs,
lib,
config,
...
}: {
config = lib.mkIf config.ar.services.syncthing.syncMusic {
services.syncthing = {
settings = {
folders = {
"music" = {
id = "6nzmu-z9der";
path = config.ar.services.syncthing.musicPath;
devices = ["lavaridge" "mauville" "petalburg" "rustboro" "wallace"];
};
};
};
};
};
}