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

77 lines
1.8 KiB
Nix
Raw Normal View History

2023-04-03 22:41:22 +08:00
{
2024-08-08 09:02:42 +08:00
config,
lib,
2024-08-11 16:15:30 +08:00
pkgs,
2024-08-08 09:02:42 +08:00
...
}: {
2024-01-14 06:29:18 +08:00
imports = [
2024-08-11 16:15:30 +08:00
# Our ephemeral system. Wipe root on reboot.
2024-01-14 06:29:18 +08:00
../common/optional/ephemeral-btrfs.nix
];
2024-08-11 16:15:30 +08:00
# Boot configuration
2024-01-14 06:29:18 +08:00
boot = {
2024-08-11 16:15:30 +08:00
# Initial ramdisk
2024-01-14 06:29:18 +08:00
initrd = {
2024-08-11 16:15:30 +08:00
# The modules listed here are available in the initrd, but are only loaded on demand.
2024-08-08 09:02:42 +08:00
availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
2024-08-11 16:15:30 +08:00
# List of modules that are always loaded by the initrd.
kernelModules = ["kvm-amd" "amdgpu"];
2023-04-06 09:33:49 +08:00
};
2024-08-11 16:15:30 +08:00
# Linux kernel used by NixOS.
kernelPackages = pkgs.linuxPackages_latest;
# Parameters added to the kernel command line.
kernelParams = [
# Enable amdgpu driver sysfs API that allows fine grain control of GPU
"amdgpu.ppfeaturemask=0xffffffff"
];
# The set of kernel modules to be loaded in the second stage of the boot process.
kernelModules = ["i2c-dev" "i2c-piix4"];
# Our boot loader configuration
2024-01-21 21:03:57 +08:00
loader = {
2024-01-14 06:29:18 +08:00
efi = {
efiSysMountPoint = "/boot";
2024-08-11 16:15:30 +08:00
canTouchEfiVariables = true;
2024-01-14 06:29:18 +08:00
};
systemd-boot = {
enable = true;
configurationLimit = 3;
};
2024-08-11 16:15:30 +08:00
};
};
# Hardware configuration
hardware = {
bluetooth = {
enable = true;
powerOnBoot = true;
};
2024-11-22 07:17:23 +08:00
graphics = {
2024-08-11 16:15:30 +08:00
enable = true;
2024-11-22 07:17:23 +08:00
enable32Bit = true;
2024-08-11 16:15:30 +08:00
extraPackages = with pkgs; [
rocmPackages.clr.icd
];
2023-04-06 09:33:49 +08:00
};
2024-01-14 06:29:18 +08:00
};
2023-04-06 09:33:49 +08:00
2024-08-11 16:15:30 +08:00
# Setup our filesystems
2024-01-14 06:29:18 +08:00
fileSystems."/boot" = {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
2023-04-06 09:33:49 +08:00
2024-01-14 06:29:18 +08:00
swapDevices = [
2024-08-08 09:02:42 +08:00
{
device = "/swap/swapfile";
size = 16 * 1024;
2024-01-14 06:29:18 +08:00
}
];
2023-04-06 09:33:49 +08:00
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
2023-04-03 22:41:22 +08:00
}