nixos/hosts/omega/hardware.nix

62 lines
1.4 KiB
Nix
Raw Normal View History

2024-03-05 22:57:41 +01:00
{
config,
lib,
pkgs,
modulesPath,
nixos-hardware,
...
}: {
2023-11-11 23:00:19 +01:00
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
nixos-hardware.nixosModules.common-cpu-amd
nixos-hardware.nixosModules.common-cpu-amd-pstate
nixos-hardware.nixosModules.common-gpu-amd
nixos-hardware.nixosModules.common-pc
nixos-hardware.nixosModules.common-pc-ssd
];
2023-08-01 15:35:09 +02:00
2024-03-05 22:57:41 +01:00
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
boot.initrd.kernelModules = ["dm-snapshot"];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
2024-06-02 22:56:02 +02:00
boot.supportedFilesystems = {ntfs = true;};
2023-08-01 15:35:09 +02:00
# https://elis.nu/blog/2020/05/nixos-tmpfs-as-root/
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
2024-08-31 03:29:21 +02:00
options = ["defaults" "size=50%" "mode=755"]; # mode=755 so only root can write to those files
2023-08-01 15:35:09 +02:00
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/nix";
neededForBoot = true;
2023-08-01 15:35:09 +02:00
fsType = "ext4";
};
swapDevices = [
2023-08-01 16:55:53 +02:00
{
device = "/nix/persist/swapfile";
size = 16 * 1024; # 16 GiB
}
2023-08-01 15:35:09 +02:00
];
2023-08-12 17:10:17 +02:00
# Windows
fileSystems."/mnt/C" = {
device = "/dev/disk/by-label/C";
fsType = "ntfs-3g";
2024-03-05 22:57:41 +01:00
options = ["rw" "uid=1000"];
2023-08-12 17:10:17 +02:00
};
2023-08-01 15:35:09 +02:00
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
2024-02-18 20:55:35 +01:00
# GPU
hardware.amdgpu.amdvlk = {
enable = true;
support32Bit.enable = true;
};
2023-08-01 15:35:09 +02:00
}