dotfiles.nix/nixos/viridian/hardware-configuration.nix

55 lines
1.2 KiB
Nix
Raw Normal View History

2024-01-21 21:03:57 +08:00
{ config, lib, ... }:
2023-10-31 05:42:06 +08:00
{
2024-01-21 21:03:57 +08:00
imports = [
../common/optional/ephemeral-btrfs.nix
];
boot = {
initrd = {
availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
kernelModules = [ "kvm-intel" ];
2023-10-31 05:42:06 +08:00
};
2024-01-21 21:03:57 +08:00
loader = {
systemd-boot.enable = true;
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
2023-10-31 05:42:06 +08:00
};
2024-01-21 21:03:57 +08:00
};
2023-10-31 05:42:06 +08:00
2024-01-21 21:03:57 +08:00
fileSystems."/boot" = {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
2023-10-31 05:42:06 +08:00
2024-01-22 20:01:52 +08:00
fileSystems."/srv/multimedia" = {
device = "/dev/disk/by-label/multimedia";
2024-01-21 21:03:57 +08:00
fsType = "ext4";
};
2023-12-19 09:21:33 +08:00
2024-01-22 20:01:52 +08:00
fileSystems."/srv/containers" = {
device = "/dev/disk/by-label/data";
fsType = "btrfs";
options = [ "subvol=containers" "compress=zstd" ];
};
fileSystems."/srv/backup" = {
device = "/dev/disk/by-label/data";
fsType = "btrfs";
options = [ "subvol=backup" "compress=zstd" ];
2024-01-21 21:03:57 +08:00
};
2023-10-31 05:42:06 +08:00
2024-01-21 21:03:57 +08:00
swapDevices = [
{ device = "/swap/swapfile";
size = 16*1024;
}
];
2023-10-31 05:42:06 +08:00
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}