Clean up VM options

This commit is contained in:
Nicolas Jeannerod 2025-01-27 17:50:10 +01:00
parent b63f9873fa
commit 9d27f2d98e
Signed by untrusted user: Niols
GPG key ID: 35DB9EC8886E1CB8
3 changed files with 39 additions and 36 deletions

View file

@ -175,11 +175,6 @@ pkgs.nixosTest {
../vm/interactive-vm.nix
];
virtualisation = {
memorySize = lib.mkVMOverride 8192;
cores = 8;
};
environment.systemPackages = with pkgs; [
python3
firefox-unwrapped

View file

@ -28,7 +28,6 @@ in
inherit value;
}) (filterAttrs (_: { website, ... }: website) cfg.ensureBuckets);
virtualisation.diskSize = 2048;
virtualisation.forwardPorts = [
{
from = "host";

View file

@ -1,9 +1,19 @@
# customize nixos-rebuild build-vm to be a bit more convenient
{ pkgs, ... }:
{ pkgs, lib, ... }:
let
inherit (lib) mkForce;
in
{
# let us log in
users.mutableUsers = false;
users.users.root.hashedPassword = "";
users = {
mutableUsers = false;
users.root = {
hashedPassword = "";
hashedPasswordFile = mkForce null;
};
};
services.openssh = {
enable = true;
settings = {
@ -13,16 +23,11 @@
};
};
# 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
w3m
xterm # for `resize`
];
environment.loginShellInit = ''
@ -32,23 +37,27 @@
extra-experimental-features = nix-command flakes
'';
virtualisation.memorySize = 2048;
virtualisation = {
memorySize = 8192;
diskSize = 2048;
cores = 8;
virtualisation.forwardPorts = [
{
from = "host";
host.port = 22222;
guest.port = 22;
}
{
from = "host";
host.port = 8080;
guest.port = 80;
}
{
from = "host";
host.port = 8443;
guest.port = 443;
}
];
forwardPorts = [
{
from = "host";
host.port = 22222;
guest.port = 22;
}
{
from = "host";
host.port = 8080;
guest.port = 80;
}
{
from = "host";
host.port = 8443;
guest.port = 443;
}
];
};
}