Skip to content

Commit 063267b

Browse files
committed
nixos/syncthing: fix flags against 2.0 release
1 parent 5e13ac3 commit 063267b

4 files changed

Lines changed: 18 additions & 11 deletions

File tree

nixos/doc/manual/release-notes/rl-2505.section.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Alongside many enhancements to NixOS modules and general system improvements, th
3232
inputs.nixpkgs.url = "https://channels.nixos.org/nixos-25.05/nixexprs.tar.xz";
3333
```
3434

35+
- Syncthing has been updated to version 2.0.0.
36+
3537
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
3638

3739
## New Modules {#sec-release-25.05-new-modules}

nixos/modules/services/networking/syncthing.nix

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -894,14 +894,19 @@ in
894894
install -Dm600 -o ${cfg.user} -g ${cfg.group} ${toString cfg.key} ${cfg.configDir}/key.pem
895895
''}
896896
''}";
897-
ExecStart = ''
898-
${cfg.package}/bin/syncthing \
899-
-no-browser \
900-
-gui-address=${if isUnixGui then "unix://" else ""}${cfg.guiAddress} \
901-
-config=${cfg.configDir} \
902-
-data=${cfg.databaseDir} \
903-
${escapeShellArgs cfg.extraFlags}
904-
'';
897+
ExecStart =
898+
let
899+
args = lib.escapeShellArgs (
900+
(lib.cli.toGNUCommandLine { } {
901+
"no-browser" = true;
902+
"gui-address" = (if isUnixGui then "unix://" else "") + cfg.guiAddress;
903+
"config" = cfg.configDir;
904+
"data" = cfg.databaseDir;
905+
})
906+
++ cfg.extraFlags
907+
);
908+
in
909+
"${lib.getExe cfg.package} ${args}";
905910
MemoryDenyWriteExecute = true;
906911
NoNewPrivileges = true;
907912
PrivateDevices = true;

nixos/tests/syncthing-folders.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ let
44
name:
55
pkgs.runCommand "syncthing-test-certs-${name}" { } ''
66
mkdir -p $out
7-
${pkgs.syncthing}/bin/syncthing generate --config=$out
7+
${pkgs.syncthing}/bin/syncthing generate --home=$out
88
${pkgs.libxml2}/bin/xmllint --xpath 'string(configuration/device/@id)' $out/config.xml > $out/id
99
'';
1010
idA = genNodeId "a";

nixos/tests/syncthing.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
a.wait_for_open_port(22000)
5656
b.wait_for_open_port(22000)
5757
58-
aDeviceID = a.succeed("syncthing -home=%s -device-id" % confdir).strip()
59-
bDeviceID = b.succeed("syncthing -home=%s -device-id" % confdir).strip()
58+
aDeviceID = a.succeed("syncthing --home=%s device-id" % confdir).strip()
59+
bDeviceID = b.succeed("syncthing --home=%s device-id" % confdir).strip()
6060
addPeer(a, "b", bDeviceID)
6161
addPeer(b, "a", aDeviceID)
6262

0 commit comments

Comments
 (0)