mio-ops/hardware/linode_vm-encrypted.nix

55 lines
1.2 KiB
Nix
Raw Normal View History

2020-05-12 03:05:09 +00:00
# Configuration common to all my encrypted Linode VMs
{
2022-03-07 14:26:15 +00:00
config,
pkgs,
lib,
...
}: {
2020-05-12 03:05:09 +00:00
imports = [
# Import the NixOS Qemu guest settings
<nixpkgs/nixos/modules/profiles/qemu-guest.nix>
];
boot = {
2022-03-07 14:26:15 +00:00
extraModulePackages = [];
2020-05-12 03:05:09 +00:00
initrd = {
2022-03-07 14:26:15 +00:00
availableKernelModules = ["virtio_pci" "ahci" "sd_mod"];
kernelModules = ["dm-snapshot"];
2020-05-12 03:05:09 +00:00
luks = {
devices = {
root = {
device = "/dev/sdb";
preLVM = true;
};
};
};
};
2022-03-07 14:26:15 +00:00
kernelModules = [];
kernelParams = ["console=ttyS0,19200n8"];
2020-05-12 03:05:09 +00:00
loader = {
grub = {
forceInstall = true;
2021-11-16 04:57:23 +00:00
version = 1;
2020-05-12 03:05:09 +00:00
extraPerEntryConfig = "root (hd0)";
extraConfig = ''
serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1;
terminal_input serial;
terminal_output serial
'';
device = "nodev";
};
timeout = 10;
};
};
# File systems configuration for the Linode VMs
2021-11-16 04:57:23 +00:00
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
2020-05-12 03:05:09 +00:00
2022-03-07 14:26:15 +00:00
swapDevices = [{device = "/dev/disk/by-label/swap";}];
2020-05-12 03:05:09 +00:00
2022-12-08 23:27:50 +00:00
nix.settings.max-jobs = lib.mkDefault 8;
2020-05-12 03:05:09 +00:00
}