2024-01-06 01:19:35 +01:00
|
|
|
# SPDX-FileCopyrightText: 2023-2024 Simon Bruder <simon@sbruder.de>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2023-05-06 10:54:03 +02:00
|
|
|
{ lib, modulesPath, ... }:
|
|
|
|
|
|
|
|
{
|
2023-12-21 15:06:16 +01:00
|
|
|
imports = [
|
|
|
|
(modulesPath + "/profiles/qemu-guest.nix")
|
|
|
|
];
|
|
|
|
|
2024-01-01 16:11:28 +01:00
|
|
|
sbruder.machine.isVm = true;
|
|
|
|
|
2023-05-06 10:54:03 +02:00
|
|
|
boot = {
|
|
|
|
kernelModules = [ ];
|
|
|
|
extraModulePackages = [ ];
|
|
|
|
kernelParams = [ "ip=dhcp" ];
|
|
|
|
initrd = {
|
2023-12-21 15:06:16 +01:00
|
|
|
availableKernelModules = [ "aesni_intel" "ahci" "sd_mod" "sr_mod" "virtio_net" "virtio_pci" "xhci_pci" ];
|
|
|
|
kernelModules = [ ];
|
2023-05-06 10:54:03 +02:00
|
|
|
network = {
|
|
|
|
enable = true; # remote unlocking
|
|
|
|
# for some reason, the DHCP server does not transmit the static route to the gateway in a form udhcpc understands
|
|
|
|
# this works around this, but is arguably quite hacky
|
|
|
|
postCommands = ''
|
2023-12-21 15:06:16 +01:00
|
|
|
ip route add 85.215.165.1 dev eth0
|
|
|
|
ip route add default via 85.215.165.1 dev eth0
|
2023-05-06 10:54:03 +02:00
|
|
|
'';
|
|
|
|
};
|
2023-12-21 15:06:16 +01:00
|
|
|
luks.devices."root".device = "/dev/disk/by-uuid/1dcb9ee1-5594-4174-98a7-a362da09f131";
|
2023-05-06 10:54:03 +02:00
|
|
|
};
|
2023-12-21 15:06:16 +01:00
|
|
|
loader.grub.device = "/dev/vda";
|
2023-05-06 10:54:03 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems = {
|
|
|
|
"/" = {
|
2023-12-21 15:06:16 +01:00
|
|
|
device = "/dev/disk/by-uuid/3ab8f4a7-952c-4b6c-93c6-7b307d5bb88b";
|
2023-05-06 10:54:03 +02:00
|
|
|
fsType = "btrfs";
|
2023-12-21 15:06:16 +01:00
|
|
|
options = [ "compress=zstd" "discard" "noatime" "ssd" ]; # for some reason, the kernel assumes rotational
|
2023-05-06 10:54:03 +02:00
|
|
|
};
|
|
|
|
"/boot" = {
|
2023-12-21 15:06:16 +01:00
|
|
|
device = "/dev/disk/by-uuid/97aec56b-5fea-4445-83dc-4a20dcf482ce";
|
2023-05-06 10:54:03 +02:00
|
|
|
fsType = "ext2";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
zramSwap = {
|
|
|
|
enable = true;
|
|
|
|
memoryPercent = 150;
|
|
|
|
};
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
useDHCP = false;
|
|
|
|
usePredictableInterfaceNames = false;
|
|
|
|
};
|
|
|
|
systemd.network = {
|
|
|
|
enable = true;
|
|
|
|
networks = {
|
|
|
|
eth0 = {
|
|
|
|
name = "eth0";
|
|
|
|
DHCP = "yes";
|
2023-12-28 23:27:34 +01:00
|
|
|
domains = [ "sbruder.de" ];
|
2023-05-06 10:54:03 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|