3 Modify in-place a nix module that configures syncthing device ids. This file can used as a normal `include` in nixos configs. This eliminates the need to copy-paste these device IDs around.
5 desktop$ syncthing-set-id syncthing-devices.nix
6 Creating /home/user/myNixOSConfigs/syncthing-devices.nix
8 desktop$ cat syncthing-devices.nix
16 "1234567-89ABCDE-FGHIJKL-MNOPQRS-TUVWXYZ-0123456-789ABCD-EFGHIJK";
24 Then, later, on another machine:
26 laptop$ syncthing-set-id syncthing-devices.nix
28 laptop$ cat syncthing-devices.nix
36 "1234567-89ABCDE-FGHIJKL-MNOPQRS-TUVWXYZ-0123456-789ABCD-EFGHIJK";
40 "1111111-2222222-3333333-4444444-5555555-6666666-7777777-8888888";
52 usage: syncthing-set-device-id file [name] [id]
53 example: syncthing-set-device-id /etc/nixos/modules/syncthing-devices.nix
54 example: syncthing-set-device-id /etc/nixos/modules/syncthing-devices.nix lappy
55 example: syncthing-set-device-id /etc/nixos/modules/syncthing-devices.nix lappy 1234567-89ABCDE-FGHIJKL-MNOPQRS-TUVWXYZ-0123456-789ABCD-EFGHIJK
57 If `name` is not specified, $HOSTNAME is used.
58 If `id` is not specified, the ID of the current system instance is used.