2021-05-30 13:19:32 +02:00
|
|
|
{ hostName
|
|
|
|
, rootUUID
|
|
|
|
, efiUUID
|
|
|
|
, swapUUID
|
|
|
|
}:
|
2021-05-30 12:51:12 +02:00
|
|
|
{ config, pkgs, lib, modulesPath, ... }@all:
|
2021-05-30 11:19:34 +02:00
|
|
|
with lib;
|
|
|
|
let
|
2021-05-30 13:19:32 +02:00
|
|
|
cfg = config.magic_rb.hardware."${hostName}";
|
2021-05-30 12:51:12 +02:00
|
|
|
qemu-guest = import (modulesPath + "/profiles/qemu-guest.nix") all;
|
2021-05-30 11:19:34 +02:00
|
|
|
in
|
|
|
|
{
|
2021-05-30 13:19:32 +02:00
|
|
|
options.magic_rb.hardware."${hostName}" = mkEnableOption "";
|
2021-05-30 11:19:34 +02:00
|
|
|
|
2021-07-31 15:30:06 +02:00
|
|
|
config = mkIf cfg (mkMerge
|
|
|
|
[
|
2021-05-30 11:19:34 +02:00
|
|
|
{
|
2021-07-31 15:30:06 +02:00
|
|
|
boot = {
|
|
|
|
kernelPackages = pkgs.linuxPackages_latest;
|
|
|
|
loader.grub.extraConfig = ''
|
|
|
|
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
|
|
|
|
terminal_input --append serial
|
|
|
|
terminal_output --append serial
|
|
|
|
'';
|
|
|
|
|
|
|
|
initrd.kernelModules = [
|
|
|
|
"nvme"
|
|
|
|
];
|
2021-05-30 11:19:34 +02:00
|
|
|
};
|
|
|
|
|
2021-07-31 15:30:06 +02:00
|
|
|
swapDevices = [
|
|
|
|
{
|
|
|
|
device = "/dev/disk/by-uuid/${swapUUID}";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
fileSystems = {
|
|
|
|
"/" =
|
|
|
|
{
|
|
|
|
device = "/dev/disk/by-uuid/${rootUUID}";
|
|
|
|
fsType = "xfs";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/boot/EFI" =
|
|
|
|
{
|
|
|
|
device = "/dev/disk/by-uuid/${efiUUID}";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
2021-05-30 11:19:34 +02:00
|
|
|
};
|
2021-07-31 15:30:06 +02:00
|
|
|
}
|
|
|
|
qemu-guest
|
|
|
|
]);
|
2021-05-30 11:19:34 +02:00
|
|
|
}
|