95 lines
3.0 KiB
Nix
95 lines
3.0 KiB
Nix
# 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, ... }:
|
||
let
|
||
kpkgs = pkgs.linuxPackages_testing;
|
||
#kpkgs = pkgs.linuxPackages_custom (pkgs.linuxPackages_latest.kernel.overrideDerivation (oldAttr: {
|
||
# enableParallelBuild = true;
|
||
#}));
|
||
in
|
||
{
|
||
imports =
|
||
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
|
||
];
|
||
|
||
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
|
||
boot.kernelModules = [ "kvm-intel" ];
|
||
boot.extraModulePackages = [ ];
|
||
boot.blacklistedKernelModules = ["psmouse"];
|
||
|
||
hardware.cpu.intel.updateMicrocode = true;
|
||
|
||
|
||
services.xserver.synaptics.enable = true;
|
||
services.thermald.enable = true;
|
||
|
||
networking.wireless.enable = true;
|
||
hardware.bluetooth.enable = true;
|
||
boot.kernelPackages = kpkgs;
|
||
boot.kernelParams = ["i915.enable_fbc=1"]; # "i915.enable_psr=1"]; # lvds downclock is no longer a thing
|
||
boot.kernelPatches = let
|
||
kver = "4.8.8"; #kpkgs.kernel.version;
|
||
linux-nvme = pkgs.fetchFromGitHub {
|
||
owner = "damige";
|
||
repo = "linux-nvme";
|
||
rev = "e58f5a1e9357fb0647fc173a17ceebe6280ba43c";
|
||
sha256 = "0n42s6a6wzckm5k6mfpx0mp66ql52wv3irs9s0c000nx039hg57m";
|
||
};
|
||
in [
|
||
# half of thesea are in 4.9 already
|
||
# { patch = "${linux-nvme}/src/${kver}/nvmepatch1-V4.patch"; name = "nvme-1";}
|
||
# { patch = "${linux-nvme}/src/${kver}/nvmepatch2-V4.patch"; name = "nvme-2";}
|
||
{ patch = "${linux-nvme}/src/${kver}/nvmepatch3-V4.patch"; name = "nvme-3";}
|
||
];
|
||
# nixpkgs.config.packageOverrides = pkgs:
|
||
# { linux_testing = pkgs.linux_testing.overrideDerivation (attrs: {
|
||
# enableParallelBuilding = true;
|
||
# });
|
||
# };
|
||
|
||
fileSystems."/" =
|
||
{ device = "/dev/disk/by-uuid/a751e4ea-f1aa-48e1-9cbe-423878e29b62";
|
||
fsType = "btrfs";
|
||
options = ["defaults" "relatime" "discard"];
|
||
};
|
||
|
||
boot.initrd.luks.devices."nix-crypt" = {
|
||
device = "/dev/disk/by-uuid/320ef81d-283f-4916-ac26-ecfb0f31e549";
|
||
allowDiscards = true;
|
||
};
|
||
|
||
fileSystems."/boot" =
|
||
{ device = "/dev/disk/by-uuid/0E07-7805";
|
||
fsType = "vfat";
|
||
};
|
||
|
||
swapDevices =
|
||
[ { device = "/dev/disk/by-uuid/d9c4c15b-0e9c-47f6-8675-93b1b8de5f9d"; }
|
||
];
|
||
|
||
nix.maxJobs = lib.mkDefault 4;
|
||
|
||
# ideal... doesn't work.
|
||
#services.udev.extraRules = ''
|
||
# KERNEL=="intel_backlight", SUBSYSTEM=="backlight", MODE="666"
|
||
#'';
|
||
# for now
|
||
systemd.services."display-manager".preStart = ''
|
||
chmod a+w $(realpath /sys/class/backlight/intel_backlight/brightness) || true
|
||
'';
|
||
# this makes sure my wifi doesn't take a minute to work
|
||
services.udev.extraRules = ''
|
||
SUBSYSTEM=="firmware", ACTION=="add", ATTR{loading}="-1"
|
||
'';
|
||
|
||
services.xserver.videoDrivers = ["modesetting"];
|
||
hardware.opengl.extraPackages = [ pkgs.vaapiIntel ];
|
||
nixpkgs.config = {
|
||
packageOverrides = pkgs : {
|
||
mpv = pkgs.mpv.override { vaapiSupport = true; };
|
||
};
|
||
};
|
||
|
||
}
|