-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardware.nix
87 lines (72 loc) · 3.08 KB
/
hardware.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
config,
lib,
modulesPath,
options,
pkgs,
specialArgs,
}:
{
hardware.enableRedistributableFirmware = true;
hardware.cpu.amd.updateMicrocode = true;
boot.kernelModules = [ "kvm-amd" ];
boot.blacklistedKernelModules = [ "nouveau" ];
# Use the latest NVIDIA out-of-tree drives.
# See https://www.nvidia.com/en-us/drivers/unix/linux-amd64-display-archive/
#hardware.graphics.enable = true;
#hardware.graphics.extraPackages = [ config.hardware.nvidia.package.out ];
hardware.nvidia.open = false;
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.latest.override {
disable32Bit = true;
};
# Make nvidia drivers available in the initrd.
#boot.extraModulePackages = [ config.hardware.nvidia.package ];
#boot.initrd.availableKernelModules = [
# "nvidia"
# "nvidia_drm"
# "nvidia_modeset"
# "nvidia_uvm"
# "nvidia_peermem"
#];
#boot.extraModprobeConfig = ''
# softdep nvidia post: nvidia-uvm
#'';
#boot.initrd.services.udev.rules = ''
# # Create /dev/nvidia-uvm when the nvidia-uvm module is loaded.
# KERNEL=="nvidia", RUN+="${pkgs.runtimeShell} -c 'mknod -m 666 /dev/nvidiactl c 195 255'"
# KERNEL=="nvidia", RUN+="${pkgs.runtimeShell} -c 'for i in $$(cat /proc/driver/nvidia/gpus/*/information | grep Minor | cut -d \ -f 4); do mknod -m 666 /dev/nvidia$${i} c 195 $${i}; done'"
# KERNEL=="nvidia_modeset", RUN+="${pkgs.runtimeShell} -c 'mknod -m 666 /dev/nvidia-modeset c 195 254'"
# KERNEL=="nvidia_uvm", RUN+="${pkgs.runtimeShell} -c 'mknod -m 666 /dev/nvidia-uvm c $$(grep nvidia-uvm /proc/devices | cut -d \ -f 1) 0'"
# KERNEL=="nvidia_uvm", RUN+="${pkgs.runtimeShell} -c 'mknod -m 666 /dev/nvidia-uvm-tools c $$(grep nvidia-uvm /proc/devices | cut -d \ -f 1) 1'"
#'';
# The zone of "Are we Wayland yet?" with the answer "mostly yes!".
hardware.nvidia.modesetting.enable = true;
# Turn off the NVIDIA settings GUI. It's not for Wayland yet.
hardware.nvidia.nvidiaSettings = false;
# Turn on the NVIDIA NixOS module which keys on this value.
services.xserver.videoDrivers = [ "nvidia" ];
# Enable Bluetooth, and work around a misconfiguration in the ConfigurationDirectoryMode.
hardware.bluetooth.enable = true;
systemd.services.bluetooth.serviceConfig.ConfigurationDirectoryMode = "0755";
hardware.logitech.wireless.enable = true;
# OpenGL, Wayland, and DRM debugging tools.
environment.systemPackages = with pkgs; [
# Small utility to dump info about DRM devices.
# https://gitlab.freedesktop.org/emersion/drm_info
drm_info
# Test utilities for OpenGL
# https://dri.freedesktop.org/wiki/glxinfo/
glxinfo
# Tool for reading and parsing EDID data from monitors
# http://www.polypux.org/projects/read-edid/
read-edid
# EDID decoder and conformance tester
# https://git.linuxtv.org/edid-decode.git
edid-decode
# Provides the `vkcube`, `vkcubepp`, `vkcube-wayland`, and `vulkaninfo` tools.
# https://github.com/KhronosGroup/Vulkan-Tools
vulkan-tools
# The NVIDIA toolset from the driver package.
#config.hardware.nvidia.package.bin
];
}