+
+ evaluatedVMConfiguration = import <nixos/nixos/lib/eval-config.nix> {
+ system = builtins.currentSystem;
+ modules = [ "${vmConfiguration}" ];
+ };
+
+ # Also include a syncthing configuration with a declarative device id
+ # because using this feature pulls in additional dependencies.
+ evaluatedSyncthingDeclarativeConfiguration = import <nixos/nixos/lib/eval-config.nix> {
+ system = builtins.currentSystem;
+ modules = [
+ ../lib/test-nixos-rebuild-switch-config.nix
+ {
+ services.syncthing = {
+ enable = true;
+ declarative.folders.forDeps.path = "/nope";
+ };
+ }
+ ];
+ };
+
+ initialConfiguration = {
+ imports = [ "${vmConfiguration}" ];
+ virtualisation.memorySize = 2048;
+ system.activationScripts.installInitialConfiguration = {
+ text = ''
+ mkdir -p /etc/nixos
+ cp "${vmConfiguration}" /etc/nixos/configuration.nix
+ '';
+ deps = [ ];
+ };
+ system.extraDependencies = [
+ evaluatedVMConfiguration.config.system.build.toplevel
+ evaluatedSyncthingDeclarativeConfiguration.config.system.build.toplevel
+ ];
+ };
+