git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/tests/cagebreak: Simplify the startup
commitf691e6c074dabf48f8ecce86d00828636709efb7 authorMichael Weiss <dev.primeos@gmail.com> dateSat 15 May 2021, 16:37 (6 years ago) parent81b2ce9
1 file changed+10−21
nixos/tests/cagebreak.nix+10−21
nixos/tests/cagebreak.nix+10−21
@@ -20,30 +20,21 @@ in
2020 # Automatically login on tty1 as a normal user:
2121 imports = [ ./common/user-account.nix ];
2222 services.getty.autologinUser = "alice";
23+ programs.bash.loginShellInit = ''
24+ if [ "$(tty)" = "/dev/tty1" ]; then
25+ set -e
26+
27+ mkdir -p ~/.config/cagebreak
28+ cp -f ${cagebreakConfigfile} ~/.config/cagebreak/config
29+
30+ cagebreak
31+ fi
32+ '';
2333
2434 hardware.opengl.enable = true;
2535 programs.xwayland.enable = true;
2636 environment.systemPackages = [ pkgs.cagebreak pkgs.wallutils ];
2737
28− systemd.services.setupCagebreakConfig = {
29− wantedBy = [ "multi-user.target" ];
30− before = [ "multi-user.target" ];
31− environment = {
32− HOME = alice.home;
33− };
34− unitConfig = {
35− type = "oneshot";
36− RemainAfterExit = true;
37− user = alice.name;
38− };
39− script = ''
40− cd $HOME
41− CONFFILE=$HOME/.config/cagebreak/config
42− mkdir -p $(dirname $CONFFILE)
43− cp ${cagebreakConfigfile} $CONFFILE
44− '';
45− };
46−
4738 virtualisation.memorySize = 1024;
4839 # Need to switch to a different VGA card / GPU driver than the default one (std) so that Cagebreak can launch:
4940 virtualisation.qemu.options = [ "-vga virtio" ];
@@ -57,8 +48,6 @@ in
5748 in ''
5849 start_all()
5950 machine.wait_for_unit("multi-user.target")
60− machine.wait_until_tty_matches(1, "alice\@machine")
61− machine.send_chars("cagebreak\n")
6251 machine.wait_for_file("${XDG_RUNTIME_DIR}/wayland-0")
6352
6453 with subtest("ensure wayland works with wayinfo from wallutils"):