Merge pull request #35432 from timokau/syncthing-deprecate-inotify

syncthing,qsyncthingtray: remove syncthing-inotify

Changed files
+8 -85
nixos
modules
services
networking
pkgs
applications
misc
qsyncthingtray
networking
top-level
+7 -23
nixos/modules/services/networking/syncthing.nix
···
available on http://127.0.0.1:8384/.
'';
-
useInotify = mkOption {
-
type = types.bool;
-
default = false;
-
description = "Provide syncthing-inotify as a service.";
-
};
-
systemService = mkOption {
type = types.bool;
default = true;
···
};
};
###### implementation
···
allowedUDPPorts = [ 21027 ];
};
-
systemd.packages = [ pkgs.syncthing ]
-
++ lib.optional cfg.useInotify pkgs.syncthing-inotify;
users = mkIf (cfg.user == defaultUser) {
extraUsers."${defaultUser}" =
···
STNOUPGRADE = "yes";
inherit (cfg) all_proxy;
} // config.networking.proxy.envVars;
-
wants = mkIf cfg.useInotify [ "syncthing-inotify.service" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Restart = "on-failure";
···
syncthing-resume = {
wantedBy = [ "suspend.target" ];
-
};
-
-
syncthing-inotify = mkIf (cfg.systemService && cfg.useInotify) {
-
description = "Syncthing Inotify File Watcher service";
-
after = [ "network.target" "syncthing.service" ];
-
requires = [ "syncthing.service" ];
-
wantedBy = [ "multi-user.target" ];
-
serviceConfig = {
-
SuccessExitStatus = "2";
-
RestartForceExitStatus = "3";
-
Restart = "on-failure";
-
User = cfg.user;
-
ExecStart = "${pkgs.syncthing-inotify.bin}/bin/syncthing-inotify -home=${cfg.dataDir} -logflags=0";
-
};
};
};
};
···
available on http://127.0.0.1:8384/.
'';
systemService = mkOption {
type = types.bool;
default = true;
···
};
};
+
imports = [
+
(mkRemovedOptionModule ["services" "syncthing" "useInotify"] ''
+
This option was removed because syncthing now has the inotify functionality included under the name "fswatcher".
+
It can be enabled on a per-folder basis through the webinterface.
+
'')
+
];
###### implementation
···
allowedUDPPorts = [ 21027 ];
};
+
systemd.packages = [ pkgs.syncthing ];
users = mkIf (cfg.user == defaultUser) {
extraUsers."${defaultUser}" =
···
STNOUPGRADE = "yes";
inherit (cfg) all_proxy;
} // config.networking.proxy.envVars;
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Restart = "on-failure";
···
syncthing-resume = {
wantedBy = [ "suspend.target" ];
};
};
};
+1 -2
pkgs/applications/misc/qsyncthingtray/default.nix
···
{ mkDerivation, stdenv, lib, fetchFromGitHub, fetchpatch, procps ? null
, qtbase, qtwebengine, qtwebkit
, cmake
-
, syncthing, syncthing-inotify ? null
, preferQWebView ? false
, preferNative ? true }:
···
${lib.optionalString stdenv.isLinux ''
substituteInPlace includes/platforms/linux/posixUtils.hpp \
--replace '"/usr/local/bin/syncthing"' '"${syncthing}/bin/syncthing"' \
-
--replace '"/usr/local/bin/syncthing-inotify"' '"${syncthing-inotify}/bin/syncthing-inotify"' \
--replace '"pgrep -x' '"${procps}/bin/pgrep -x'
''}
···
{ mkDerivation, stdenv, lib, fetchFromGitHub, fetchpatch, procps ? null
, qtbase, qtwebengine, qtwebkit
, cmake
+
, syncthing
, preferQWebView ? false
, preferNative ? true }:
···
${lib.optionalString stdenv.isLinux ''
substituteInPlace includes/platforms/linux/posixUtils.hpp \
--replace '"/usr/local/bin/syncthing"' '"${syncthing}/bin/syncthing"' \
--replace '"pgrep -x' '"${procps}/bin/pgrep -x'
''}
-21
pkgs/applications/networking/syncthing/inotify-deps.nix
···
-
# This file was generated by https://github.com/kamilchm/go2nix v1.2.0
-
[
-
{
-
goPackagePath = "github.com/syncthing/syncthing";
-
fetch = {
-
type = "git";
-
url = "https://github.com/syncthing/syncthing";
-
rev = "d0061c172caecd3baf61f3ff720f56fdb805186e";
-
sha256 = "08cn0ym4arjppbnfn2b37crarwmiqbj4yjr7kinhdxx9gqm5wkj1";
-
};
-
}
-
{
-
goPackagePath = "golang.org/x/sys";
-
fetch = {
-
type = "git";
-
url = "https://go.googlesource.com/sys";
-
rev = "fb4cac33e3196ff7f507ab9b2d2a44b0142f5b5a";
-
sha256 = "1y5lx3f7rawfxrqg0s2ndgbjjjaml3rn3f27h9w9c5mw3xk7lrgj";
-
};
-
}
-
]
···
-37
pkgs/applications/networking/syncthing/inotify.nix
···
-
{ stdenv, buildGoPackage, fetchFromGitHub }:
-
-
buildGoPackage rec {
-
name = "syncthing-inotify-${version}";
-
version = "0.8.6";
-
-
goPackagePath = "github.com/syncthing/syncthing-inotify";
-
-
src = fetchFromGitHub {
-
owner = "syncthing";
-
repo = "syncthing-inotify";
-
rev = "v${version}";
-
sha256 = "0z1zpb7av4q5nj2d4yda9jcbjdz4yj3823c29y73yf0gfp26lppl";
-
};
-
-
goDeps = ./inotify-deps.nix;
-
-
postInstall = ''
-
mkdir -p $bin/lib/systemd/{system,user}
-
-
substitute $src/etc/linux-systemd/system/syncthing-inotify@.service \
-
$bin/lib/systemd/system/syncthing-inotify@.service \
-
--replace /usr/bin/syncthing-inotify $bin/bin/syncthing-inotify
-
-
substitute $src/etc/linux-systemd/user/syncthing-inotify.service \
-
$bin/lib/systemd/user/syncthing-inotify.service \
-
--replace /usr/bin/syncthing-inotify $bin/bin/syncthing-inotify
-
'';
-
-
meta = with stdenv.lib; {
-
homepage = https://github.com/syncthing/syncthing-inotify;
-
description = "File watcher intended for use with Syncthing";
-
license = licenses.mpl20;
-
maintainers = with maintainers; [ joko peterhoeg ];
-
platforms = platforms.unix;
-
};
-
}
···
-2
pkgs/top-level/all-packages.nix
···
syncthing-gtk = python2Packages.callPackage ../applications/networking/syncthing-gtk { };
-
syncthing-inotify = callPackage ../applications/networking/syncthing/inotify.nix { };
-
syncthing-tray = callPackage ../applications/misc/syncthing-tray { };
# linux only by now
···
syncthing-gtk = python2Packages.callPackage ../applications/networking/syncthing-gtk { };
syncthing-tray = callPackage ../applications/misc/syncthing-tray { };
# linux only by now