helm/hosts/shiro/hardware-configuration.nix
Henrik Lissner a75c64d04a
Rewrite to use flakes
This puts a hard dependency on 20.09, but that's to be expected.
2020-10-11 01:31:33 -04:00

59 lines
1.7 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, inputs, modulesPath, ... }:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
inputs.nixos-hardware.nixosModules.dell-xps-13-9370
];
boot = {
initrd.availableKernelModules = [ "xhci_pci" "nvme" "rtsx_pci_sdmmc" ];
initrd.kernelModules = [ "dm-snapshot" ];
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
# 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.
kernelParams = [ "mitigations=off" ];
};
# CPU
nix.maxJobs = lib.mkDefault 8;
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
hardware.cpu.intel.updateMicrocode = true;
# Power management
environment.systemPackages = [ pkgs.acpi ];
powerManagement.powertop.enable = true;
programs.light.enable = true; # Monitor backlight control
# Storage
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";
fsType = "ext4";
options = [ "noatime" ];
};
};
swapDevices = [ { device = "/dev/disk/by-label/swap"; }];
boot.initrd.luks.devices.home = {
device = "/dev/nvme0n1p8";
preLVM = true;
allowDiscards = true;
};
}