{ lib, pkgs, modulesPath, ... }: let inherit (pkgs) system; nodeName = "ssh"; deploy = (import ./data-model.nix { inherit system modulesPath; config = { inherit nodeName; inherit (import ./constants.nix) pathToRoot; targetSystem = system; sshOpts = [ ]; }; }).default.ssh-host.run; in { _class = "nixosTest"; name = "deployment-model"; sourceFileset = lib.fileset.unions [ ../../data-model.nix ../../function.nix ../../nixos.nix ../../run/ssh-single-host/run.sh ../../../npins/default.nix ../../../npins/sources.json ./constants.nix ]; nodes.deployer = { ... }: { environment.systemPackages = [ deploy ]; system.extraDependenciesFromModule = { pkgs, ... }: { environment.systemPackages = with pkgs; [ hello ]; }; }; extraTestScript = '' with subtest("Check the status before deployment"): ssh.fail("hello 1>&2") with subtest("Run the deployment"): output = deployer.fail(""" ${lib.getExe deploy} """) assert "Timeout, server ${nodeName} not responding" in output ssh.wait_for_unit("multi-user.target") ssh.succeed("su - operator -c hello 1>&2") ''; }