2020-10-01 15:46:04 -07:00
|
|
|
{ config, lib, pkgs, inputs, modulesPath, ... }:
|
2020-01-17 01:31:10 -08:00
|
|
|
|
|
|
|
{
|
|
|
|
imports = [
|
2020-10-01 15:46:04 -07:00
|
|
|
(modulesPath + "/installer/scan/not-detected.nix")
|
|
|
|
inputs.nixos-hardware.nixosModules.dell-xps-13-9370
|
2020-01-17 01:31:10 -08:00
|
|
|
];
|
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
boot = {
|
|
|
|
initrd.availableKernelModules = [ "xhci_pci" "nvme" "rtsx_pci_sdmmc" ];
|
|
|
|
initrd.kernelModules = [ "dm-snapshot" ];
|
|
|
|
kernelModules = [ "kvm-intel" ];
|
|
|
|
extraModulePackages = [ ];
|
2021-02-21 07:30:01 -08:00
|
|
|
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"
|
|
|
|
];
|
2021-02-21 10:16:14 -08:00
|
|
|
|
|
|
|
# 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-10-01 15:46:04 -07:00
|
|
|
};
|
2020-01-17 01:31:10 -08:00
|
|
|
|
2021-02-01 21:32:57 -08:00
|
|
|
# Modules
|
|
|
|
modules.hardware = {
|
|
|
|
audio.enable = true;
|
|
|
|
fs = {
|
|
|
|
enable = true;
|
|
|
|
ssd.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
# CPU
|
2020-01-17 01:31:10 -08:00
|
|
|
nix.maxJobs = lib.mkDefault 8;
|
2020-04-12 18:02:27 -07:00
|
|
|
hardware.cpu.intel.updateMicrocode = true;
|
2021-01-29 11:06:06 -08:00
|
|
|
# performance gives better battery life/perf than ondemand on sandy bridge and
|
|
|
|
# newer because of intel pstates.
|
|
|
|
powerManagement.cpuFreqGovernor = "performance";
|
2020-01-17 01:31:10 -08:00
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
# Power management
|
|
|
|
environment.systemPackages = [ pkgs.acpi ];
|
|
|
|
powerManagement.powertop.enable = true;
|
2020-10-15 00:42:02 -07:00
|
|
|
# Monitor backlight control
|
|
|
|
programs.light.enable = true;
|
|
|
|
user.extraGroups = [ "video" ];
|
2020-01-17 01:31:10 -08:00
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
# Storage
|
2020-01-17 01:31:10 -08:00
|
|
|
fileSystems = {
|
|
|
|
"/" = {
|
2020-01-17 02:47:43 -08:00
|
|
|
device = "/dev/disk/by-label/nixos";
|
2020-01-17 01:31:10 -08:00
|
|
|
fsType = "ext4";
|
2020-01-17 02:47:43 -08:00
|
|
|
options = [ "noatime" ];
|
2020-01-17 01:31:10 -08:00
|
|
|
};
|
|
|
|
"/boot" = {
|
2020-01-17 02:47:43 -08:00
|
|
|
device = "/dev/disk/by-label/BOOT";
|
2020-01-17 01:31:10 -08:00
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
"/home" = {
|
2020-01-17 02:47:43 -08:00
|
|
|
device = "/dev/disk/by-label/home";
|
2020-01-17 01:31:10 -08:00
|
|
|
fsType = "ext4";
|
2020-01-17 02:47:43 -08:00
|
|
|
options = [ "noatime" ];
|
2020-01-17 01:31:10 -08:00
|
|
|
};
|
2021-02-01 21:29:22 -08:00
|
|
|
"/usr/drive" = {
|
|
|
|
device = "kiiro:/volume1/homes/hlissner/Drive";
|
|
|
|
fsType = "nfs";
|
2021-02-20 14:53:57 -08:00
|
|
|
options = [
|
2021-02-21 07:31:31 -08:00
|
|
|
"nofail" "noauto" "noatime" "x-systemd.automount" "x-systemd.idle-timeout=5min"
|
2021-02-20 14:53:57 -08:00
|
|
|
"nodev" "nosuid" "noexec"
|
|
|
|
];
|
2021-02-01 21:29:22 -08:00
|
|
|
};
|
2020-01-17 01:31:10 -08:00
|
|
|
};
|
|
|
|
swapDevices = [ { device = "/dev/disk/by-label/swap"; }];
|
2020-10-01 15:46:04 -07:00
|
|
|
|
2020-04-23 22:02:08 -07:00
|
|
|
boot.initrd.luks.devices.home = {
|
2020-01-17 02:47:43 -08:00
|
|
|
device = "/dev/nvme0n1p8";
|
|
|
|
preLVM = true;
|
|
|
|
allowDiscards = true;
|
2020-04-23 22:02:08 -07:00
|
|
|
};
|
2020-01-17 01:31:10 -08:00
|
|
|
}
|