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" ''
{
name = "syncthing";
nodes = {
- a = "${configuration}";
- b = "${configuration}";
+ a = "${initialConfiguration}";
+ b = "${initialConfiguration}";
};
testScript = ''
)
- initialConfiguration = "${configuration}"
configurationWithDeviceIDs = (
"${configurationWithDeviceIDs}"
)
- setConfig(a, initialConfiguration)
a.wait_for_unit("syncthing-autoregister.service")
setConfig(a, configurationWithDeviceIDs)
verifyDeviceIDSet(a, "a")