X-Git-Url: http://git.scottworley.com/syncthing-autoregister/blobdiff_plain/0a262b7925af942e617dd75bc531ec9d96836608..2475b5344ca33d7aad5b57f42310994d60b80ee3:/tests/automatic-enrollment.nix diff --git a/tests/automatic-enrollment.nix b/tests/automatic-enrollment.nix index 8cbcdc4..1a6b360 100644 --- a/tests/automatic-enrollment.nix +++ b/tests/automatic-enrollment.nix @@ -17,6 +17,18 @@ import ({ pkgs, lib, ... }: environment.systemPackages = with pkgs; [ nix ]; } ''; + initialConfiguration = pkgs.writeText "initial-configuration.nix" '' + { + imports = [ "${configuration}" ]; + system.activationScripts.installInitialConfiguration = { + text = ''' + mkdir -p /etc/nixos + cp "${configuration}" /etc/nixos/configuration.nix + '''; + deps = [ ]; + }; + } + ''; configurationWithDeviceIDs = pkgs.writeText "configuration-with-device-ids.nix" '' { @@ -31,8 +43,8 @@ import ({ pkgs, lib, ... }: name = "syncthing"; nodes = { - a = "${configuration}"; - b = "${configuration}"; + a = "${initialConfiguration}"; + b = "${initialConfiguration}"; }; testScript = '' @@ -47,12 +59,10 @@ import ({ pkgs, lib, ... }: ) - initialConfiguration = "${configuration}" configurationWithDeviceIDs = ( "${configurationWithDeviceIDs}" ) - setConfig(a, initialConfiguration) a.wait_for_unit("syncthing-autoregister.service") setConfig(a, configurationWithDeviceIDs) verifyDeviceIDSet(a, "a")