maxwell/testing.nix

34 lines
758 B
Nix
Raw Normal View History

2021-06-17 19:05:24 +02:00
{ pkgs, lib, ... }:
2020-10-26 14:05:27 +01:00
let
secrets = toString ./secrets;
in
{
imports = [
<nixpkgs/nixos/modules/virtualisation/qemu-vm.nix>
./configuration.nix
];
2020-11-10 01:05:00 +01:00
virtualisation.memorySize = "4000"; # MB
2021-06-17 19:05:24 +02:00
virtualisation.graphics = false;
2020-11-10 01:05:00 +01:00
2021-06-17 19:05:24 +02:00
virtualisation.qemu.options =
[ # Ensure secrets are accessible by the
# activation scripts at runtime.
"-virtfs local,path=${secrets},security_model=none,mount_tag=secrets"
];
2020-11-10 01:05:00 +01:00
2021-06-17 19:05:24 +02:00
virtualisation.fileSystems."${secrets}" =
{ device = "secrets";
fsType = "9p";
options = [ "trans=virtio" "version=9p2000.L" ];
neededForBoot = true;
};
2020-11-10 01:05:00 +01:00
2021-06-17 19:05:24 +02:00
# Automatically resize the console
environment.systemPackages = [ pkgs.xterm ];
environment.shellInit = "resize > /dev/null";
2020-10-26 14:05:27 +01:00
}