mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 21:01:34 +01:00
Move hardware config files into directory
This commit is contained in:
parent
cb3daa129c
commit
fa4d802536
7 changed files with 2 additions and 2 deletions
32
hosts/inspiron/hardware/default.nix
Normal file
32
hosts/inspiron/hardware/default.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
63
hosts/inspiron/hardware/disko.nix
Normal file
63
hosts/inspiron/hardware/disko.nix
Normal 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" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue