95 lines
2.3 KiB
Nix
95 lines
2.3 KiB
Nix
{ config, lib, modulesPath, pkgs, ... }:
|
|
|
|
{
|
|
imports = [
|
|
(modulesPath + "/installer/scan/not-detected.nix")
|
|
];
|
|
|
|
# Hostname.
|
|
networking.hostName = "thinkpad-p50";
|
|
|
|
# Enable bluetooth
|
|
hardware.bluetooth = {
|
|
enable = true;
|
|
powerOnBoot = false;
|
|
};
|
|
|
|
# Bootloader and boot options
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
|
|
boot.initrd.kernelModules = [ ];
|
|
boot.kernelModules = [ "kvm-intel" ];
|
|
boot.extraModulePackages = [ ];
|
|
|
|
# Filesystems
|
|
fileSystems."/" = {
|
|
device = "/dev/disk/by-uuid/f3d7ecac-7dfd-40a8-8771-02223a993bd4";
|
|
fsType = "ext4";
|
|
};
|
|
|
|
fileSystems."/run/media/ulysse-cura/Data" = {
|
|
device = "/dev/disk/by-uuid/ea67b685-b7d2-4205-8515-b02c481c7cd0";
|
|
fsType = "ext4";
|
|
};
|
|
|
|
fileSystems."/boot" = {
|
|
device = "/dev/disk/by-uuid/0012-EABE";
|
|
fsType = "vfat";
|
|
options = [ "fmask=0077" "dmask=0077" ];
|
|
};
|
|
|
|
swapDevices = [{
|
|
device = "/dev/disk/by-uuid/7ad6bd01-60c6-41c9-859e-ac18bc8a62ca";
|
|
}];
|
|
|
|
# Platform misc
|
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
|
|
# Thinkfan
|
|
services.thinkfan.enable = true;
|
|
services.thinkfan.fans = [{
|
|
type = "tpacpi";
|
|
query = "/proc/acpi/ibm/fan";
|
|
}];
|
|
services.thinkfan.sensors = [{
|
|
type = "tpacpi";
|
|
query = "/proc/acpi/ibm/thermal";
|
|
}];
|
|
services.thinkfan.levels = [
|
|
[ 0 0 50 ]
|
|
[ 1 48 56 ]
|
|
[ 2 54 62 ]
|
|
[ 3 60 68 ]
|
|
[ 6 66 74 ]
|
|
[ 7 72 80 ]
|
|
[ "level full-speed" 78 32767 ]
|
|
];
|
|
|
|
# Enable and configure nvidia graphics drivers
|
|
hardware.graphics.enable = true;
|
|
services.xserver.videoDrivers = [
|
|
"modesetting"
|
|
"nvidia"
|
|
];
|
|
|
|
hardware.nvidia.open = false;
|
|
hardware.nvidia.modesetting.enable = true;
|
|
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_580;
|
|
hardware.graphics.extraPackages = with pkgs; [
|
|
vulkan-loader
|
|
vulkan-validation-layers
|
|
vulkan-extension-layer
|
|
];
|
|
|
|
hardware.nvidia.prime = {
|
|
offload.enable = true;
|
|
offload.enableOffloadCmd = true;
|
|
|
|
intelBusId = "PCI:0@0:2:0";
|
|
nvidiaBusId = "PCI:1@0:0:0";
|
|
};
|
|
}
|