helm/hosts/kuro/hardware-configuration.nix

97 lines
2.7 KiB
Nix
Raw Permalink Normal View History

{ config, lib, pkgs, modulesPath, ... }:
2020-01-17 01:22:50 -08:00
{
imports = [ "${modulesPath}/installer/scan/not-detected.nix" ];
2020-01-17 01:22:50 -08:00
boot = {
initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
initrd.kernelModules = [];
extraModulePackages = [];
kernelModules = [ "kvm-amd" ];
kernelParams = [
# HACK Disables fixes for spectre, meltdown, L1TF and a number of CPU
# vulnerabilities. Don't copy this blindly! And especially not for
# mission critical or server/headless builds exposed to the world.
"mitigations=off"
];
# Refuse ICMP echo requests on my desktop/laptop; nobody has any business
# pinging them, unlike my servers.
kernel.sysctl."net.ipv4.icmp_echo_ignore_broadcasts" = 1;
};
2020-01-17 01:22:50 -08:00
# Modules
modules.hardware = {
audio.enable = true;
ergodox.enable = true;
fs = {
enable = true;
ssd.enable = true;
};
nvidia.enable = true;
sensors.enable = true;
};
# CPU
nix.maxJobs = lib.mkDefault 16;
2020-01-17 01:22:50 -08:00
powerManagement.cpuFreqGovernor = "performance";
hardware.cpu.amd.updateMicrocode = true;
2020-01-17 01:22:50 -08:00
# Displays
services.xserver = {
# This must be done manually to ensure my screen spaces are arranged exactly
# as I need them to be *and* the correct monitor is "primary". Using
# xrandrHeads does not work.
monitorSection = ''
VendorName "Unknown"
ModelName "DELL U2515H"
HorizSync 30.0 - 113.0
VertRefresh 56.0 - 86.0
Option "DPMS"
'';
screenSection = ''
Option "metamodes" "HDMI-0: nvidia-auto-select +1920+0, DVI-I-1: nvidia-auto-select +0+180, DVI-D-0: nvidia-auto-select +4480+180"
Option "SLI" "Off"
Option "MultiGPU" "Off"
Option "BaseMosaic" "off"
Option "Stereo" "0"
Option "nvidiaXineramaInfoOrder" "DFP-1"
'';
};
2020-01-17 01:22:50 -08:00
# Storage
2020-01-17 01:22:50 -08:00
fileSystems = {
"/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
options = [ "noatime" ];
};
"/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
};
"/home" = {
device = "/dev/disk/by-label/home";
2020-01-17 01:22:50 -08:00
fsType = "ext4";
options = [ "noatime" ];
};
2021-02-01 21:29:22 -08:00
"/usr/drive" = {
device = "kiiro:/volume1/homes/hlissner/Drive";
fsType = "nfs";
options = [
"nofail" "noauto" "noatime" "x-systemd.automount" "x-systemd.idle-timeout=5min"
"nodev" "nosuid" "noexec"
];
};
"/usr/store" = {
device = "/dev/disk/by-label/store";
fsType = "ext4";
options = [
"noauto" "noatime" "x-systemd.automount" "x-systemd.idle-timeout=5min"
"nodev" "nosuid" "noexec"
];
2021-02-01 21:29:22 -08:00
};
2020-01-17 01:22:50 -08:00
};
swapDevices = [];
2020-01-17 01:22:50 -08:00
}