diff --git a/users/pbsds/syncthing.nix b/users/pbsds/syncthing.nix index 1b443c9..502d95f 100644 --- a/users/pbsds/syncthing.nix +++ b/users/pbsds/syncthing.nix @@ -8,7 +8,7 @@ (pkgs.makeDesktopItem { desktopName = "Open 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"; }) ]; @@ -41,7 +41,9 @@ /* devices."bjarte".autoAcceptFolders = true; # TODO */ folders = lib.flip lib.pipe [ + # add `path` default (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.mkMerge ] {