2024-03-20 00:43:20 +01:00
|
|
|
{ pkgs, ... }: {
|
2024-05-28 16:08:57 +02:00
|
|
|
|
|
|
|
# Customize nixos-rebuild build-vm to be a bit more convenient
|
2024-03-20 00:43:20 +01:00
|
|
|
virtualisation.vmVariant = {
|
|
|
|
# let us log in
|
|
|
|
users.mutableUsers = false;
|
|
|
|
users.users.root.hashedPassword = "";
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
PermitRootLogin = "yes";
|
|
|
|
PermitEmptyPasswords = "yes";
|
|
|
|
UsePAM = "no";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# automatically log in
|
|
|
|
services.getty.autologinUser = "root";
|
2024-05-25 01:02:12 +02:00
|
|
|
services.getty.helpLine = ''
|
|
|
|
Type `C-a c` to access the qemu console
|
|
|
|
Type `C-a x` to quit
|
|
|
|
'';
|
2024-03-20 00:43:20 +01:00
|
|
|
# access to convenient things
|
2024-05-25 01:02:12 +02:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
w3m
|
|
|
|
python3
|
|
|
|
xterm # for `resize`
|
|
|
|
];
|
|
|
|
environment.loginShellInit = ''
|
|
|
|
eval "$(resize)"
|
|
|
|
'';
|
2024-03-20 00:43:20 +01:00
|
|
|
nix.extraOptions = ''
|
|
|
|
extra-experimental-features = nix-command flakes
|
|
|
|
'';
|
|
|
|
|
|
|
|
# no graphics. see nixos-shell
|
|
|
|
virtualisation = {
|
|
|
|
graphics = false;
|
|
|
|
qemu.consoles = [ "tty0" "hvc0" ];
|
|
|
|
qemu.options = [
|
|
|
|
"-serial null"
|
|
|
|
"-device virtio-serial"
|
|
|
|
"-chardev stdio,mux=on,id=char0,signal=off"
|
|
|
|
"-mon chardev=char0,mode=readline"
|
|
|
|
"-device virtconsole,chardev=char0,nr=0"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|