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

69 lines
1.6 KiB
Nix
Raw Normal View History

2024-01-21 21:03:57 +08:00
{ config, lib, ... }:
2024-06-03 21:13:38 +08:00
let
hostname = config.networking.hostName;
in
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" = {
2024-06-03 21:13:38 +08:00
device = "/dev/disk/by-label/${hostname}";
2024-01-22 20:01:52 +08:00
fsType = "btrfs";
options = [ "subvol=containers" "compress=zstd" ];
};
2024-06-03 21:13:38 +08:00
fileSystems."/srv/services" = {
device = "/dev/disk/by-label/${hostname}";
fsType = "btrfs";
options = [ "subvol=services" "compress=zstd" ];
};
2024-06-03 21:10:23 +08:00
fileSystems."/srv/shares" = {
device = "/dev/disk/by-label/data";
fsType = "btrfs";
options = [ "subvol=shares" "compress=zstd" ];
};
2024-01-22 20:01:52 +08:00
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;
}