Move hardware config files into directory

This commit is contained in:
SebastianStork 2024-08-11 21:54:20 +02:00
parent cb3daa129c
commit fa4d802536
7 changed files with 2 additions and 2 deletions

View file

@ -0,0 +1,32 @@
{ inputs, ... }:
{
imports = [
inputs.disko.nixosModules.default
./disko.nix
];
nixpkgs.hostPlatform = "x86_64-linux";
hardware = {
enableRedistributableFirmware = true;
cpu.amd.updateMicrocode = true;
};
boot = {
kernelModules = [ "kvm-amd" ];
initrd.kernelModules = [ "usb_storage" ];
initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"sd_mod"
];
};
zramSwap.enable = true;
services = {
fstrim.enable = true;
fwupd.enable = true;
auto-cpufreq.enable = true;
};
}

View file

@ -0,0 +1,63 @@
{
disko.devices = {
disk.main = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
type = "EF00";
size = "512M";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "defaults" ];
};
};
luks = {
size = "100%";
content = {
name = "cryptroot";
type = "luks";
settings = {
allowDiscards = true;
bypassWorkqueues = true;
keyFile = "/dev/disk/by-id/usb-SCSI_DISK-0:0";
keyFileSize = 512;
keyFileTimeout = 5;
};
additionalKeyFiles = [ "/tmp/secret.key" ];
content = {
type = "lvm_pv";
vg = "pool";
};
};
};
};
};
};
lvm_vg.pool = {
type = "lvm_vg";
lvs = {
swap = {
size = "20G";
content = {
type = "swap";
resumeDevice = true;
};
};
root = {
size = "100%FREE";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [ "defaults" ];
};
};
};
};
};
}