Clean up VM options

This commit is contained in:
Nicolas Jeannerod 2025-01-27 17:50:10 +01:00
parent a740364f04
commit f15669e51e
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 ../vm/interactive-vm.nix
]; ];
virtualisation = {
memorySize = lib.mkVMOverride 8192;
cores = 8;
};
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
python3 python3
firefox-unwrapped firefox-unwrapped

View file

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

View file

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