aboutsummaryrefslogtreecommitdiffstats
path: root/tests/qemu/debug.nix
blob: 498266eac152e5208573ba8e49535e4b524a09ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# A layer for testing in qemu (see default.nix): a root shell script run
# at the end of boot, whose output goes to the console (the test's
# stdout).  (virtio_pci, which qemu needs, is in the base system.)
script: { pkgs, config, lib, ... }: {
  systemd.services.rig-test = {
    wantedBy = [ "multi-user.target" ];
    after = [ "multi-user.target" ];
    path = [ pkgs.util-linux pkgs.coreutils "/run/current-system/sw" ];
    environment = lib.mkIf config.rig.nix {
      NIX_REMOTE = "daemon";
      NIX_PATH = "nixpkgs=/nixpkgs";
    };
    serviceConfig.StandardOutput = "tty";
    serviceConfig.StandardError = "tty";
    serviceConfig.TTYPath = "/dev/console";
    inherit script;
  };
}