summaryrefslogtreecommitdiff
path: root/modules/nixos/syncthing.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-05-21 23:10:32 +0300
committerAzat Bahawi <azat@bahawi.net>2023-05-21 23:10:32 +0300
commitb07e10139c88d6060e57ca52b2dc12b17b53ac82 (patch)
tree5b5cddc2f47bddb8e8914aa66ae18d52cd519965 /modules/nixos/syncthing.nix
parent8f7371998f813857f25afef4160075665f924ab7 (diff)
2023-05-21
Diffstat (limited to 'modules/nixos/syncthing.nix')
-rw-r--r--modules/nixos/syncthing.nix117
1 files changed, 60 insertions, 57 deletions
diff --git a/modules/nixos/syncthing.nix b/modules/nixos/syncthing.nix
index b0d98bc..faf6723 100644
--- a/modules/nixos/syncthing.nix
+++ b/modules/nixos/syncthing.nix
@@ -48,74 +48,77 @@ in {
key = config.secrets."syncthing-key-${this.hostname}".path;
overrideDevices = true;
- devices = mapAttrs (name: attr:
- mkIf (attr.syncthing.id != null && hasAttr "wireguard" attr) {
- inherit (attr.syncthing) id;
- addresses = ["tcp://${name}.${config.networking.domain}:22000"];
- introducer = this.isHeadless;
- })
- my.configurations;
-
overrideFolders = true;
- folders = let
- filterDevices = f:
- attrNames (filterAttrs (_: attr:
- (attr.hostname != this.hostname)
- && (attr.syncthing.id != null)
- && f attr)
- my.configurations);
- all = filterDevices (_: true);
- notHeadless = filterDevices (attr: !attr.isHeadless);
- notOther = filterDevices (attr: !attr.isOther);
- simple = {
- type = "simple";
- params.keep = "5";
- };
- trashcan = {
- type = "trashcan";
- params.cleanoutDays = "7";
- };
- in
- with config.hm.xdg.userDirs; {
- share = {
- path = publicShare;
- devices = notHeadless;
- versioning = trashcan;
- };
- pass = {
- path = config.hm.programs.password-store.settings.PASSWORD_STORE_DIR;
- devices = notOther;
- versioning = trashcan;
- };
- org = {
- path = "${documents}/org";
- devices = all;
- versioning = simple;
- };
- roam = {
- path = "${documents}/roam";
- devices = notOther;
- versioning = simple;
+ settings = {
+ devices = mapAttrs (name: attr:
+ mkIf (attr.syncthing.id != null && hasAttr "wireguard" attr) {
+ inherit (attr.syncthing) id;
+ addresses = ["tcp://${name}.${config.networking.domain}:22000"];
+ introducer = this.isHeadless;
+ })
+ my.configurations;
+
+ folders = let
+ filterDevices = f:
+ attrNames (filterAttrs (_: attr:
+ (attr.hostname != this.hostname)
+ && (attr.syncthing.id != null)
+ && f attr)
+ my.configurations);
+ all = filterDevices (_: true);
+ notHeadless = filterDevices (attr: !attr.isHeadless);
+ notOther = filterDevices (attr: !attr.isOther);
+
+ simple = {
+ type = "simple";
+ params.keep = "5";
};
- elfeed = {
- path = "${config.my.home}/.elfeed";
- devices = notOther;
- versioning = trashcan;
+ trashcan = {
+ type = "trashcan";
+ params.cleanoutDays = "7";
};
- books = {
- path = "${documents}/books";
- devices = notOther;
- versioning = trashcan;
+ in
+ with config.hm.xdg.userDirs; {
+ share = {
+ path = publicShare;
+ devices = notHeadless;
+ versioning = trashcan;
+ };
+ pass = {
+ path = config.hm.programs.password-store.settings.PASSWORD_STORE_DIR;
+ devices = notOther;
+ versioning = trashcan;
+ };
+ org = {
+ path = "${documents}/org";
+ devices = all;
+ versioning = simple;
+ };
+ roam = {
+ path = "${documents}/roam";
+ devices = notOther;
+ versioning = simple;
+ };
+ elfeed = {
+ path = "${config.my.home}/.elfeed";
+ devices = notOther;
+ versioning = trashcan;
+ };
+ books = {
+ path = "${documents}/books";
+ devices = notOther;
+ versioning = trashcan;
+ };
};
- };
- extraOptions = {
gui = {
insecureAdminAccess = true;
insecureSkipHostcheck = this.isHeadless;
};
+
options = {
+ testOption = false;
autoUpgradeIntervalH = 0;
crashReportingEnabled = false;
globalAnnounceEnabled = false;