]> git.scottworley.com Git - syncthing-autoregister/blobdiff - pkgs/syncthing-set-id.nix
Follow services.syncthing.declarative rename
[syncthing-autoregister] / pkgs / syncthing-set-id.nix
index 0277983370b4f1eb1d4347cb4f8f1e585160c165..f20798d83508f1ecc04e34c48ae842e54c34ae15 100644 (file)
@@ -21,7 +21,7 @@ writeShellScriptBin "syncthing-set-id" ''
   file=$(realpath "$1")
   name=''${2:-"$HOSTNAME"}
   if (( $# < 3));then
-    configDir=$(${nix}/bin/nix eval --raw '(import <nixos/nixos> {}).config.services.syncthing.configDir')
+    configDir=$(${nix}/bin/nix --experimental-features nix-command eval --impure --raw --expr '(import <nixos/nixos> {}).config.services.syncthing.configDir')
     id=$(${syncthing}/bin/syncthing -home="$configDir" -device-id)
   else
     id=$3
@@ -44,7 +44,7 @@ writeShellScriptBin "syncthing-set-id" ''
       { file, name, id }:
       let pkgs = import <nixpkgs> { };
       in pkgs.lib.generators.toPretty { } (pkgs.lib.recursiveUpdate (import file) {
-        services.syncthing.declarative.devices."''${name}".id = id;
+        services.syncthing.devices."''${name}".id = id;
       })
     ' | ${jq}/bin/jq -r | ${nixfmt}/bin/nixfmt > "$tmp"