2024-09-01 18:52:20 +02:00
|
|
|
{ self, pkgs }:
|
|
|
|
|
2024-09-01 19:33:48 +02:00
|
|
|
self.inputs.nixpkgs.lib.nixos.runTest {
|
2024-04-02 11:15:15 +02:00
|
|
|
name = "neovim";
|
2024-09-01 18:52:20 +02:00
|
|
|
hostPkgs = pkgs;
|
2024-09-01 19:35:45 +02:00
|
|
|
node.specialArgs.nix-config = self;
|
2024-09-01 18:52:20 +02:00
|
|
|
|
2024-08-03 20:42:39 +02:00
|
|
|
nodes.machine =
|
2024-10-16 05:01:19 +02:00
|
|
|
{ nix-config, config, ... }:
|
2024-08-03 20:42:39 +02:00
|
|
|
{
|
2024-09-01 19:43:24 +02:00
|
|
|
imports = with nix-config.nixosModules; [
|
|
|
|
shell
|
|
|
|
system
|
|
|
|
];
|
2024-08-03 20:42:39 +02:00
|
|
|
|
2024-09-01 20:11:59 +02:00
|
|
|
home-manager.sharedModules = with nix-config.homeModules; [
|
|
|
|
neovim
|
|
|
|
];
|
2024-10-16 05:01:19 +02:00
|
|
|
|
|
|
|
services.getty.autologinUser = config.modules.system.username;
|
2024-04-05 15:02:00 +02:00
|
|
|
};
|
2024-08-03 20:42:39 +02:00
|
|
|
|
|
|
|
testScript = # python
|
|
|
|
''
|
|
|
|
machine.wait_for_unit("default.target")
|
|
|
|
|
2024-10-16 05:07:33 +02:00
|
|
|
machine.send_chars("nvim hello.txt\n")
|
2024-08-03 20:42:39 +02:00
|
|
|
machine.sleep(20)
|
|
|
|
|
|
|
|
machine.send_chars("i")
|
|
|
|
machine.sleep(2)
|
|
|
|
machine.send_chars("Hello world")
|
|
|
|
machine.sleep(2)
|
|
|
|
machine.send_key("esc")
|
|
|
|
machine.sleep(2)
|
2024-10-16 05:07:33 +02:00
|
|
|
machine.send_chars(":wq\n")
|
2024-08-03 20:42:39 +02:00
|
|
|
machine.sleep(2)
|
|
|
|
|
|
|
|
text = machine.succeed("cat /home/user/hello.txt")
|
|
|
|
|
|
|
|
assert "Hello world" in text
|
|
|
|
'';
|
2024-09-01 19:33:48 +02:00
|
|
|
}
|