migrate away from vmware
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
../../modules/logging.nix
|
||||
../../modules/motd.nix
|
||||
../../modules/kernel.nix
|
||||
./disk-config.nix
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
@@ -100,15 +101,15 @@
|
||||
services.xserver.videoDrivers = [ "vmware" ];
|
||||
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
options = [ "defaults" "noatime" ];
|
||||
};
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-label/ESP";
|
||||
fsType = "vfat";
|
||||
};
|
||||
#fileSystems."/" = {
|
||||
# device = "/dev/disk/by-label/nixos";
|
||||
# fsType = "ext4";
|
||||
# options = [ "defaults" "noatime" ];
|
||||
#};
|
||||
#fileSystems."/boot" =
|
||||
#{ device = "/dev/disk/by-label/ESP";
|
||||
# fsType = "vfat";
|
||||
#};
|
||||
fileSystems."/data" = {
|
||||
device = "/dev/disk/by-uuid/d117419d-fce9-4d52-85c7-e3481feaa22a";
|
||||
fsType = "btrfs";
|
||||
|
||||
38
systems/amd-server-vm/disk-config.nix
Normal file
38
systems/amd-server-vm/disk-config.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
# Example to create a bios compatible gpt partition
|
||||
{ lib, ... }: {
|
||||
disko.devices = {
|
||||
disk.main = {
|
||||
device = lib.mkDefault "/dev/vda";
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
name = "boot";
|
||||
size = "1M";
|
||||
type = "EF02";
|
||||
};
|
||||
esp = {
|
||||
name = "ESP";
|
||||
size = "500M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ]; # Override existing partition
|
||||
mountpoint = "/";
|
||||
mountOptions = [ "compress=zstd" "noatime" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -14,30 +14,12 @@
|
||||
#tmpfs.enable = true;
|
||||
nftables.enable = true;
|
||||
cli-tools.enable = true;
|
||||
virt-manager.enable = true;
|
||||
nix = {
|
||||
index.enable = true;
|
||||
ld.enable = true;
|
||||
settings.enable = true;
|
||||
};
|
||||
static-ip = {
|
||||
enable = true;
|
||||
ip = "192.168.0.20";
|
||||
interface = "enp6s0";
|
||||
dns = "192.168.0.10";
|
||||
};
|
||||
# static-ip = {
|
||||
# enable = true;
|
||||
# interface = "enp42s0";
|
||||
# ip = "192.168.0.11";
|
||||
# #dns = "127.0.0.1";
|
||||
# dns = "192.168.10";
|
||||
# #gateway = "192.168.0.10";
|
||||
# };
|
||||
# It uses 1.1.1.1 for some reason? set in /etc/dnsmasq-resolv.conf. no idea why
|
||||
#services.dnsmasq = {
|
||||
# enable = true;
|
||||
# server = [ "192.168.0.10" ];
|
||||
#};
|
||||
services = { syncthing = { enable = true; }; };
|
||||
hardware = {
|
||||
firmware.enable = true;
|
||||
@@ -56,31 +38,32 @@
|
||||
mainUser.layout = "de";
|
||||
mainUser.variant = "us";
|
||||
|
||||
virtualisation.vmware.host.enable = true;
|
||||
networking = {
|
||||
useNetworkd = true; # Ensure networkd is used, as it handles bridging well
|
||||
defaultGateway.interface = "br0"; # Set the default gateway
|
||||
defaultGateway.address = "192.168.0.1";
|
||||
useDHCP = false;
|
||||
nameservers = [ "192.168.0.10" "1.1.1.1" ];
|
||||
interfaces.enp6s0 = {
|
||||
name = "eth0";
|
||||
ipv4.addresses = [];
|
||||
};
|
||||
|
||||
systemd.services.start-vm = {
|
||||
description = "Start VM";
|
||||
wants = [ "network-online.target" ];
|
||||
after =
|
||||
[ "network.target" "network-online.target" "vmware-networks.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "forking"; # ?????? doesnt work without it, thanks vmware
|
||||
ExecStart = let
|
||||
script = pkgs.writeShellScript "start-vm" ''
|
||||
sleep 10
|
||||
${pkgs.vmware-workstation}/bin/vmrun start /root/vmware/server/server.vmx nogui
|
||||
'';
|
||||
in "${script}";
|
||||
User = "root";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "5s";
|
||||
ProtectHome = false;
|
||||
ProtectSystem = false;
|
||||
bridges.br0 = {
|
||||
interfaces = [ "eth0" ]; # Add eth0 to the bridge
|
||||
};
|
||||
interfaces.br0 = {
|
||||
ipv4.addresses = [{
|
||||
address = "192.168.0.20";
|
||||
prefixLength = 24;
|
||||
}];
|
||||
};
|
||||
};
|
||||
|
||||
services.xrdp.enable = true;
|
||||
services.xrdp.defaultWindowManager = "xfce4-session";
|
||||
services.xrdp.openFirewall = true;
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
audio.enable = true;
|
||||
code = {
|
||||
enable = true;
|
||||
#android.enable = true;
|
||||
android.enable = true;
|
||||
};
|
||||
#emulators.enable = true;
|
||||
gamemode.enable = true;
|
||||
|
||||
Reference in New Issue
Block a user