mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-29 19:46:17 +01:00
a6572e0d4e
Signed-off-by: Magic_RB <magic_rb@redalder.org>
50 lines
1,017 B
Nix
50 lines
1,017 B
Nix
{ hostName
|
|
, rootUUID
|
|
, efiUUID
|
|
, swapUUID
|
|
}:
|
|
{ config, pkgs, lib, modulesPath, ... }@all:
|
|
with lib;
|
|
let
|
|
cfg = config.magic_rb.hardware."${hostName}";
|
|
qemu-guest = import (modulesPath + "/profiles/qemu-guest.nix") all;
|
|
in
|
|
{
|
|
options.magic_rb.hardware."${hostName}" = mkEnableOption "";
|
|
|
|
config = mkIf cfg ({
|
|
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"
|
|
];
|
|
};
|
|
|
|
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";
|
|
};
|
|
};
|
|
} // qemu-guest);
|
|
}
|