diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index 421e363b2260..a537467bc1e0 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -32,6 +32,8 @@ Alongside many enhancements to NixOS modules and general system improvements, th inputs.nixpkgs.url = "https://channels.nixos.org/nixos-25.05/nixexprs.tar.xz"; ``` +- Syncthing has been updated to version 2.0.0. + ## New Modules {#sec-release-25.05-new-modules} diff --git a/nixos/modules/services/networking/syncthing.nix b/nixos/modules/services/networking/syncthing.nix index 12e0c2bea79d..19c8ce15dfec 100644 --- a/nixos/modules/services/networking/syncthing.nix +++ b/nixos/modules/services/networking/syncthing.nix @@ -894,14 +894,19 @@ in install -Dm600 -o ${cfg.user} -g ${cfg.group} ${toString cfg.key} ${cfg.configDir}/key.pem ''} ''}"; - ExecStart = '' - ${cfg.package}/bin/syncthing \ - -no-browser \ - -gui-address=${if isUnixGui then "unix://" else ""}${cfg.guiAddress} \ - -config=${cfg.configDir} \ - -data=${cfg.databaseDir} \ - ${escapeShellArgs cfg.extraFlags} - ''; + ExecStart = + let + args = lib.escapeShellArgs ( + (lib.cli.toGNUCommandLine { } { + "no-browser" = true; + "gui-address" = (if isUnixGui then "unix://" else "") + cfg.guiAddress; + "config" = cfg.configDir; + "data" = cfg.databaseDir; + }) + ++ cfg.extraFlags + ); + in + "${lib.getExe cfg.package} ${args}"; MemoryDenyWriteExecute = true; NoNewPrivileges = true; PrivateDevices = true; diff --git a/nixos/tests/syncthing-folders.nix b/nixos/tests/syncthing-folders.nix index d0623f7194d5..dbce02b279f2 100644 --- a/nixos/tests/syncthing-folders.nix +++ b/nixos/tests/syncthing-folders.nix @@ -4,7 +4,7 @@ let name: pkgs.runCommand "syncthing-test-certs-${name}" { } '' mkdir -p $out - ${pkgs.syncthing}/bin/syncthing generate --config=$out + ${pkgs.syncthing}/bin/syncthing generate --home=$out ${pkgs.libxml2}/bin/xmllint --xpath 'string(configuration/device/@id)' $out/config.xml > $out/id ''; idA = genNodeId "a"; diff --git a/nixos/tests/syncthing.nix b/nixos/tests/syncthing.nix index 6ba21fb89fc2..a16d77aebce4 100644 --- a/nixos/tests/syncthing.nix +++ b/nixos/tests/syncthing.nix @@ -55,8 +55,8 @@ a.wait_for_open_port(22000) b.wait_for_open_port(22000) - aDeviceID = a.succeed("syncthing -home=%s -device-id" % confdir).strip() - bDeviceID = b.succeed("syncthing -home=%s -device-id" % confdir).strip() + aDeviceID = a.succeed("syncthing --home=%s device-id" % confdir).strip() + bDeviceID = b.succeed("syncthing --home=%s device-id" % confdir).strip() addPeer(a, "b", bDeviceID) addPeer(b, "a", aDeviceID) diff --git a/pkgs/applications/networking/syncthing/default.nix b/pkgs/applications/networking/syncthing/default.nix index 09827ae5c663..9ff6abdcfd49 100644 --- a/pkgs/applications/networking/syncthing/default.nix +++ b/pkgs/applications/networking/syncthing/default.nix @@ -19,16 +19,16 @@ let }: buildGoModule rec { pname = stname; - version = "1.30.0"; + version = "2.0.3"; src = fetchFromGitHub { owner = "syncthing"; repo = "syncthing"; tag = "v${version}"; - hash = "sha256-GKyzJ2kzs2h/tfb3StSleGBofiKk6FwVcSkCjsJRvRY="; + hash = "sha256-s5kW7FJfLSTezG/PvRGEoBBlMhYUoszpduKFKlnCcaU="; }; - vendorHash = "sha256-Soky/3wEmP1QRy8xfL68sTHi3CSl4nbCINmG0DY2Qys="; + vendorHash = "sha256-Ws++TwmOcWe1ArRuQzIgEIUCHGC30LU4Y4zYUrBkpmA="; nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ # Recent versions of macOS seem to require binaries to be signed when