This commit is contained in:
Peder Bergebakken Sundt 2024-10-10 21:24:11 +02:00
parent 9bc3213367
commit dfd8f31f1e
1 changed files with 3 additions and 1 deletions

View File

@ -8,7 +8,7 @@
(pkgs.makeDesktopItem { (pkgs.makeDesktopItem {
desktopName = "Open Syncthing"; desktopName = "Open Syncthing";
name = "Syncthing"; name = "Syncthing";
exec = "${pkgs.xdg-utils}/bin/xdg-open ${config.services.syncthing.guiAddress}"; exec = "${pkgs.xdg-utils}/bin/xdg-open http://${config.services.syncthing.guiAddress}";
icon = "${pkgs.syncthing.src}/assets/logo-512.png"; icon = "${pkgs.syncthing.src}/assets/logo-512.png";
}) })
]; ];
@ -41,7 +41,9 @@
/* devices."bjarte".autoAcceptFolders = true; # TODO */ /* devices."bjarte".autoAcceptFolders = true; # TODO */
folders = lib.flip lib.pipe [ folders = lib.flip lib.pipe [
# add `path` default
(lib.mapAttrs (name: attrs: { path = lib.mkDefault "${config.services.syncthing.dataDir}/${name}"; } // attrs )) (lib.mapAttrs (name: attrs: { path = lib.mkDefault "${config.services.syncthing.dataDir}/${name}"; } // attrs ))
# filter folders this host does not have access to
(lib.mapAttrsToList (name: attrs: lib.mkIf (builtins.elem config.networking.hostName (attrs.devices or [])) { ${name} = attrs; } )) (lib.mapAttrsToList (name: attrs: lib.mkIf (builtins.elem config.networking.hostName (attrs.devices or [])) { ${name} = attrs; } ))
lib.mkMerge lib.mkMerge
] { ] {