mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-16 06:47:09 +03:00
25bef2d8f9
The library does not depend on stdenv, that `stdenv` exposes `lib` is an artifact of the ancient origins of nixpkgs.
36 lines
991 B
Nix
36 lines
991 B
Nix
import ./make-test-python.nix ({ pkgs, ...} : {
|
|
name = "zsh-history";
|
|
meta = with pkgs.lib.maintainers; {
|
|
maintainers = [ kampka ];
|
|
};
|
|
|
|
nodes.default = { ... }: {
|
|
programs = {
|
|
zsh.enable = true;
|
|
};
|
|
environment.systemPackages = [ pkgs.zsh-history ];
|
|
programs.zsh.interactiveShellInit = ''
|
|
source ${pkgs.zsh-history.out}/share/zsh/init.zsh
|
|
'';
|
|
users.users.root.shell = "${pkgs.zsh}/bin/zsh";
|
|
};
|
|
|
|
testScript = ''
|
|
start_all()
|
|
default.wait_for_unit("multi-user.target")
|
|
default.wait_until_succeeds("pgrep -f 'agetty.*tty1'")
|
|
|
|
# Login
|
|
default.wait_until_tty_matches(1, "login: ")
|
|
default.send_chars("root\n")
|
|
default.wait_until_tty_matches(1, "root@default>")
|
|
|
|
# Generate some history
|
|
default.send_chars("echo foobar\n")
|
|
default.wait_until_tty_matches(1, "foobar")
|
|
|
|
# Ensure that command was recorded in history
|
|
default.succeed("/run/current-system/sw/bin/history list | grep -q foobar")
|
|
'';
|
|
})
|