56 lines
1.2 KiB
Nix
56 lines
1.2 KiB
Nix
{config, ...}: {
|
|
services.syncthing = {
|
|
# enable = true;
|
|
# user = "toast";
|
|
# group = "users";
|
|
# dataDir = config.users.users.toast.home;
|
|
settings.folders."passwords".path = "~/Documents/Passwords";
|
|
};
|
|
age.secrets = {
|
|
syncthingCert = {
|
|
owner = "toast";
|
|
group = "users";
|
|
};
|
|
syncthingKey = {
|
|
owner = "toast";
|
|
group = "users";
|
|
};
|
|
};
|
|
home-manager.users.toast = {
|
|
osConfig,
|
|
lib,
|
|
...
|
|
}: let
|
|
systemConfig = osConfig.services.syncthing;
|
|
missingOptions = [
|
|
"all_proxy"
|
|
"configDir"
|
|
"dataDir"
|
|
"databaseDir"
|
|
"declarative"
|
|
"devices"
|
|
"folders"
|
|
"extraFlags"
|
|
"user"
|
|
"group"
|
|
"systemService"
|
|
"openDefaultPorts"
|
|
"options"
|
|
"relay"
|
|
"useInotify"
|
|
];
|
|
removeMissingOptions = rawOptions: (
|
|
# lib.attrsets.filterAttrs (n: v: n == "all_proxy") rawOptions
|
|
builtins.removeAttrs rawOptions missingOptions
|
|
);
|
|
in {
|
|
services.syncthing =
|
|
removeMissingOptions systemConfig
|
|
// {
|
|
enable = true;
|
|
# Renamed options
|
|
allProxy = systemConfig.all_proxy;
|
|
extraOptions = systemConfig.extraFlags;
|
|
};
|
|
};
|
|
}
|