2024-08-28 14:35:48 +02:00
|
|
|
# customize nixos-rebuild build-vm to be a bit more convenient
|
2024-11-11 17:25:42 +01:00
|
|
|
{ pkgs, ... }:
|
|
|
|
{
|
2024-08-28 14:35:48 +02:00
|
|
|
# let us log in
|
|
|
|
users.mutableUsers = false;
|
|
|
|
users.users.root.hashedPassword = "";
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
PermitRootLogin = "yes";
|
|
|
|
PermitEmptyPasswords = "yes";
|
|
|
|
UsePAM = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# automatically log in
|
|
|
|
services.getty.autologinUser = "root";
|
|
|
|
services.getty.helpLine = ''
|
|
|
|
Type `C-a c` to access the qemu console
|
|
|
|
Type `C-a x` to quit
|
|
|
|
'';
|
|
|
|
# access to convenient things
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
w3m
|
|
|
|
python3
|
|
|
|
xterm # for `resize`
|
|
|
|
];
|
|
|
|
environment.loginShellInit = ''
|
|
|
|
eval "$(resize)"
|
|
|
|
'';
|
|
|
|
nix.extraOptions = ''
|
|
|
|
extra-experimental-features = nix-command flakes
|
|
|
|
'';
|
|
|
|
|
2024-11-16 19:40:47 +01:00
|
|
|
virtualisation.memorySize = 2048;
|
2024-08-28 14:35:48 +02:00
|
|
|
|
|
|
|
virtualisation.forwardPorts = [
|
2024-10-30 19:38:39 +01:00
|
|
|
{
|
|
|
|
from = "host";
|
|
|
|
host.port = 22222;
|
|
|
|
guest.port = 22;
|
|
|
|
}
|
2024-08-28 14:35:48 +02:00
|
|
|
{
|
|
|
|
from = "host";
|
|
|
|
host.port = 8080;
|
2024-11-16 19:40:47 +01:00
|
|
|
guest.port = 80;
|
2024-08-28 14:35:48 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
from = "host";
|
|
|
|
host.port = 8443;
|
2024-11-16 19:40:47 +01:00
|
|
|
guest.port = 443;
|
2024-08-28 14:35:48 +02:00
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|