add radish-vm for testing

This commit is contained in:
Joakim Repomaa
2025-07-11 11:37:28 +03:00
parent 3e37b4bcbc
commit 5b3ceb239d
8 changed files with 130 additions and 1 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
/result /result
/.direnv /.direnv
/.gcroots /.gcroots
*.qcow2

View File

@@ -102,6 +102,7 @@
in in
{ {
radish = mkConfiguration "radish"; radish = mkConfiguration "radish";
radish-vm = mkConfiguration "radish-vm";
freun-dev = mkConfiguration "freun-dev"; freun-dev = mkConfiguration "freun-dev";
apu = mkConfiguration "apu"; apu = mkConfiguration "apu";
}; };

View File

@@ -187,7 +187,7 @@ in
}; };
edit_predictions = { edit_predictions = {
enabled = true; enabled = true;
mode = "subtle"; mode = "eager";
provider = "zed"; provider = "zed";
}; };
buffer_font_family = "Iosevka Nerd Font"; buffer_font_family = "Iosevka Nerd Font";
@@ -200,6 +200,11 @@ in
"tsconfig.*.json" "tsconfig.*.json"
]; ];
}; };
context_servers = {
browser-tools-context-server = {
npx_command = "${pkgs.nodejs}/bin/npx";
};
};
}; };
userKeymaps = [ userKeymaps = [
{ {

21
hosts/radish-vm/boot.nix Normal file
View File

@@ -0,0 +1,21 @@
{ pkgs, ... }:
{
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
loader.systemd-boot.configurationLimit = 10;
kernelPackages = pkgs.linuxPackages_latest;
tmp.useTmpfs = true;
kernel.sysctl = {
"vm.max_map_count" = 262144;
};
binfmt.emulatedSystems = [ "aarch64-linux" ];
};
environment.systemPackages = with pkgs; [
efibootmgr
];
}

View File

@@ -0,0 +1,24 @@
{ inputs, ... }:
let
inherit (inputs)
home-manager
;
in
{
imports = [
./hardware-configuration.nix
# Import most of the original radish config
../radish/configuration.nix
../radish/host.nix
../radish/packages.nix
../radish/containers.nix
../radish/desktop.nix
../radish/users.nix
../radish/secrets.nix
# VM-specific overrides
./boot.nix
./hardware.nix
home-manager.nixosModules.home-manager
../../home
];
}

View File

@@ -0,0 +1,64 @@
# VM Hardware Configuration Template
# This file will be generated during VM installation with `nixos-generate-config`
# But here's a template for common VM setups
{
lib,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
# Boot configuration for VMs
boot = {
initrd = {
availableKernelModules = [
"ahci"
"xhci_pci"
"virtio_pci"
"virtio_scsi"
"sr_mod"
"virtio_blk"
"vmw_pvscsi"
];
kernelModules = [ ];
};
kernelModules = [ ];
extraModulePackages = [ ];
};
networking = {
useDHCP = lib.mkDefault true;
};
hardware = {
graphics = {
enable = true;
};
};
services = {
spice-vdagentd.enable = lib.mkDefault true;
qemuGuest.enable = lib.mkDefault true;
};
virtualisation = {
vmware.guest.enable = lib.mkDefault false;
virtualbox.guest.enable = lib.mkDefault false;
hypervGuest.enable = lib.mkDefault false;
vmVariant.virtualisation = {
memorySize = 8192;
cores = 4;
};
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement = {
enable = lib.mkDefault false;
};
}

View File

@@ -0,0 +1,11 @@
{
...
}:
{
hardware.graphics = {
enable = true;
};
services.fstrim.enable = true; # Still useful for VM disk optimization
services.openssh.enable = true;
}

View File

@@ -6,6 +6,7 @@
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" ]; extraGroups = [ "wheel" ];
shell = pkgs.zsh; shell = pkgs.zsh;
initialPassword = "changeme";
}; };
users.users.moco = { users.users.moco = {
@@ -13,6 +14,7 @@
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" ]; extraGroups = [ "wheel" ];
shell = pkgs.zsh; shell = pkgs.zsh;
initialPassword = "changeme";
subUidRanges = [ subUidRanges = [
{ {
startUid = 10000; startUid = 10000;