Creating kvm test server

This commit is contained in:
2025-11-22 13:05:42 +01:00
parent 59b184cc2c
commit ff17f33531
19 changed files with 366 additions and 178 deletions

View File

@@ -5,8 +5,8 @@
...
}:
{
system.stateVersion = "25.11";
system.stateVersion = "25.05";
imports = [
./disk-config.nix
./hardware-configuration.nix
@@ -83,6 +83,7 @@
pkgs.nixos-anywhere
pkgs.nixos-generators
pkgs.ssh-to-age
pkgs.htop
];
services.openssh.enable = true;

View File

@@ -6,7 +6,7 @@
disk = {
main = {
type = "disk";
device = "/dev/nvme0n1";
device = "/dev/vda";
content = {
type = "gpt";
partitions = {
@@ -23,42 +23,88 @@
};
SYS = {
size = "100%";
type = "8309";
type = "8300";
name = "SYS";
content = {
type = "luks";
name = "rootfs";
settings = {
allowDiscards = true;
};
content = {
type = "btrfs";
extraArgs = [ "-f --nodiscard --label root" ];
subvolumes = {
"@" = {
mountpoint = "/";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
};
"@root" = {
mountpoint = "/root";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
};
"@home" = {
mountpoint = "/home";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
};
"@nix" = {
mountpoint = "/nix";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
};
"@var" = {
mountpoint = "/var";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
};
"@games" = {
mountpoint = "/games";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
};
type = "btrfs";
extraArgs = [ "-f --nodiscard --label root" ];
subvolumes = {
"@" = {
mountpoint = "/";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@root" = {
mountpoint = "/root";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@home" = {
mountpoint = "/home";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@nix" = {
mountpoint = "/nix";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@var" = {
mountpoint = "/var";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@data" = {
mountpoint = "/games";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@backups" = {
mountpoint = "/games";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
};
};

View File

@@ -5,14 +5,13 @@
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}