mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-22 08:14:00 +01:00
0b0deb55b7
Fixes an issue where NixOS tests weren't exactly treated as containers, presumably since they run inside QEMU. The previous dependency on stylix is no longer necessary since base16-nvim was upstreamed, although it may be ideal to split it into its own module at a later date.
55 lines
1.1 KiB
Nix
55 lines
1.1 KiB
Nix
{ self, pkgs }:
|
|
|
|
self.inputs.nixpkgs.lib.nixos.runTest {
|
|
name = "neovim";
|
|
hostPkgs = pkgs;
|
|
node.specialArgs.nix-config = self;
|
|
|
|
nodes.machine =
|
|
{ nix-config, ... }:
|
|
{
|
|
imports = with nix-config.nixosModules; [
|
|
shell
|
|
system
|
|
];
|
|
|
|
home-manager.sharedModules = with nix-config.homeModules; [
|
|
neovim
|
|
];
|
|
};
|
|
|
|
testScript = # python
|
|
''
|
|
machine.wait_for_unit("default.target")
|
|
|
|
machine.send_chars("user")
|
|
machine.sleep(1)
|
|
machine.send_key("ret")
|
|
machine.sleep(1)
|
|
machine.send_chars("user")
|
|
machine.sleep(1)
|
|
machine.send_key("ret")
|
|
machine.sleep(5)
|
|
|
|
machine.send_chars("nvim hello.txt")
|
|
machine.sleep(1)
|
|
machine.send_key("ret")
|
|
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)
|
|
machine.send_chars(":wq")
|
|
machine.sleep(2)
|
|
machine.send_key("ret")
|
|
machine.sleep(2)
|
|
|
|
text = machine.succeed("cat /home/user/hello.txt")
|
|
|
|
assert "Hello world" in text
|
|
'';
|
|
}
|