2020-10-01 15:46:04 -07:00
|
|
|
{ config, lib, pkgs, modulesPath, ... }:
|
|
|
|
|
2020-01-17 01:22:50 -08:00
|
|
|
{
|
2020-10-01 15:46:04 -07:00
|
|
|
imports = [ "${modulesPath}/installer/scan/not-detected.nix" ];
|
2020-01-17 01:22:50 -08:00
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
boot = {
|
|
|
|
initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
|
|
|
|
initrd.kernelModules = [];
|
|
|
|
extraModulePackages = [];
|
2021-01-29 11:06:18 -08:00
|
|
|
kernelModules = [ "kvm-amd" ];
|
2020-10-01 15:46:04 -07:00
|
|
|
kernelParams = [
|
|
|
|
# HACK Disables fixes for spectre, meltdown, L1TF and a number of CPU
|
|
|
|
# vulnerabilities. This is not a good idea for mission critical or
|
|
|
|
# server/headless builds, but on my lonely home system I prioritize
|
|
|
|
# raw performance over security. The gains are minor.
|
|
|
|
"mitigations=off"
|
|
|
|
# Limit ZFS cache to 8gb. Sure, this system has 64gb, but I don't want
|
|
|
|
# this biting me when I'm running multiple VMs.
|
|
|
|
"zfs.zfs_arc_max=8589934592"
|
|
|
|
];
|
|
|
|
};
|
2020-01-17 01:22:50 -08:00
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
# CPU
|
|
|
|
nix.maxJobs = lib.mkDefault 16;
|
2020-01-17 01:22:50 -08:00
|
|
|
powerManagement.cpuFreqGovernor = "performance";
|
2020-10-01 15:46:04 -07:00
|
|
|
hardware.cpu.amd.updateMicrocode = true;
|
2020-01-17 01:22:50 -08:00
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
# Displays
|
|
|
|
services.xserver = {
|
2021-01-31 15:20:17 -08:00
|
|
|
# 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.
|
2020-10-01 15:46:04 -07:00
|
|
|
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
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
# Storage
|
|
|
|
networking.hostId = "edd9f26b"; # required by zfs
|
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";
|
|
|
|
};
|
2020-10-01 15:46:04 -07:00
|
|
|
"/home" = {
|
|
|
|
device = "/dev/disk/by-label/home";
|
2020-01-17 01:22:50 -08:00
|
|
|
fsType = "ext4";
|
|
|
|
options = [ "noatime" ];
|
|
|
|
};
|
2020-10-01 15:46:04 -07:00
|
|
|
"/usr/backup" = {
|
|
|
|
device = "usr/backup";
|
|
|
|
fsType = "zfs";
|
2021-01-26 17:27:58 -08:00
|
|
|
options = [ "nofail" ];
|
2020-01-17 01:22:50 -08:00
|
|
|
};
|
2020-10-01 15:46:04 -07:00
|
|
|
"/usr/media" = {
|
|
|
|
device = "usr/media";
|
|
|
|
fsType = "zfs";
|
2021-01-26 17:27:58 -08:00
|
|
|
options = [ "nofail" ];
|
2020-10-01 15:46:04 -07:00
|
|
|
};
|
|
|
|
"/usr/local" = {
|
|
|
|
device = "usr/local";
|
|
|
|
fsType = "zfs";
|
2021-01-26 17:27:58 -08:00
|
|
|
options = [ "nofail" ];
|
2020-10-01 15:46:04 -07:00
|
|
|
};
|
|
|
|
"/usr/share" = {
|
|
|
|
device = "usr/share";
|
|
|
|
fsType = "zfs";
|
2021-01-26 17:27:58 -08:00
|
|
|
options = [ "nofail" ];
|
2020-01-17 01:22:50 -08:00
|
|
|
};
|
|
|
|
};
|
2020-10-01 15:46:04 -07:00
|
|
|
swapDevices = [];
|
2020-01-17 01:22:50 -08:00
|
|
|
}
|