diff options
Diffstat (limited to 'tests/qemu/debug.nix')
| -rw-r--r-- | tests/qemu/debug.nix | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/qemu/debug.nix b/tests/qemu/debug.nix new file mode 100644 index 0000000..a8790de --- /dev/null +++ b/tests/qemu/debug.nix @@ -0,0 +1,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.fc-test = { + wantedBy = [ "multi-user.target" ]; + after = [ "multi-user.target" ]; + path = [ pkgs.util-linux pkgs.coreutils "/run/current-system/sw" ]; + environment = lib.mkIf config.fc.nix { + NIX_REMOTE = "daemon"; + NIX_PATH = "nixpkgs=/nixpkgs"; + }; + serviceConfig.StandardOutput = "tty"; + serviceConfig.StandardError = "tty"; + serviceConfig.TTYPath = "/dev/console"; + inherit script; + }; +} |
