2023-07-01 10:23:32 +02:00
|
|
|
{ lib, config, pkgs, ... }: {
|
|
|
|
|
2023-07-13 11:08:12 +02:00
|
|
|
# Set your time zone.
|
|
|
|
time.timeZone = "Asia/Tokyo";
|
2023-07-06 05:24:21 +02:00
|
|
|
|
2023-07-01 11:37:30 +02:00
|
|
|
# Set the networking hostname:
|
2023-07-01 11:38:21 +02:00
|
|
|
networking.hostName = "nixos-laptop";
|
2023-07-01 11:37:30 +02:00
|
|
|
|
2023-07-01 10:23:32 +02:00
|
|
|
# Configure the fingerprint reader
|
|
|
|
services.fprintd = {
|
|
|
|
enable = true;
|
|
|
|
tod.enable = true;
|
|
|
|
tod.driver = pkgs.libfprint-2-tod1-vfs0090;
|
|
|
|
};
|
|
|
|
|
2023-07-05 14:58:58 +02:00
|
|
|
# Enable nVidia PRIME Render Offload and OpenGL
|
2023-07-01 10:23:32 +02:00
|
|
|
# https://github.com/NixOS/nixos-hardware/blob/master/lenovo/thinkpad/p1/3th-gen/nvidia.nix
|
2023-07-05 14:58:58 +02:00
|
|
|
hardware = {
|
|
|
|
opengl.enable = true;
|
|
|
|
opengl.driSupport32Bit = true;
|
2023-07-12 13:52:15 +02:00
|
|
|
opengl.driSupport = true;
|
2023-07-15 15:31:06 +02:00
|
|
|
opengl.extraPackages = with pkgs; [ nvidia-vaapi-driver ];
|
2023-07-16 10:05:34 +02:00
|
|
|
|
2023-07-12 08:29:53 +02:00
|
|
|
nvidia = {
|
2023-07-15 15:31:06 +02:00
|
|
|
open = true;
|
2023-07-16 10:06:08 +02:00
|
|
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
2023-07-15 15:57:44 +02:00
|
|
|
powerManagement.finegrained = true;
|
2023-07-16 06:37:09 +02:00
|
|
|
powerManagement.enable = true;
|
2023-07-15 14:44:41 +02:00
|
|
|
modesetting.enable = true;
|
2023-07-12 08:29:53 +02:00
|
|
|
prime = {
|
2023-07-14 16:59:52 +02:00
|
|
|
offload = {
|
|
|
|
enable = true;
|
|
|
|
enableOffloadCmd = true;
|
|
|
|
};
|
2023-07-12 08:29:53 +02:00
|
|
|
intelBusId = lib.mkDefault "PCI:0:2:0";
|
|
|
|
nvidiaBusId = lib.mkDefault "PCI:1:0:0";
|
|
|
|
};
|
2023-07-05 14:58:58 +02:00
|
|
|
};
|
2023-07-01 10:23:32 +02:00
|
|
|
};
|
|
|
|
|
2023-07-15 15:31:06 +02:00
|
|
|
services.xserver.videoDrivers = [ "nvidia" ];
|
|
|
|
|
|
|
|
environment.variables = {
|
|
|
|
GBM_BACKEND = "nvidia-drm";
|
|
|
|
LIBVA_DRIVER_NAME = "nvidia";
|
|
|
|
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
|
|
|
};
|
2023-07-12 16:41:12 +02:00
|
|
|
|
2023-07-12 05:54:40 +02:00
|
|
|
environment.systemPackages = with pkgs; [
|
2023-07-12 08:08:57 +02:00
|
|
|
# Fingerprint software
|
2023-07-12 05:54:40 +02:00
|
|
|
fprintd
|
2023-07-15 14:26:08 +02:00
|
|
|
# nVidia graphcis options
|
2023-07-15 15:31:06 +02:00
|
|
|
vulkan-loader
|
|
|
|
vulkan-validation-layers
|
|
|
|
vulkan-tools
|
2023-07-15 15:52:02 +02:00
|
|
|
gwe
|
2023-07-16 08:51:38 +02:00
|
|
|
|
|
|
|
# wine install
|
|
|
|
# support both 32- and 64-bit applications
|
|
|
|
wineWowPackages.stable
|
|
|
|
# support 32-bit only
|
|
|
|
wine
|
|
|
|
# support 64-bit only
|
2023-07-16 10:08:34 +02:00
|
|
|
# (wine.override { wineBuild = "wine64"; })
|
2023-07-16 08:51:38 +02:00
|
|
|
# wine-staging (version with experimental features)
|
|
|
|
wineWowPackages.staging
|
|
|
|
# winetricks (all versions)
|
|
|
|
winetricks
|
|
|
|
# native wayland support (unstable)
|
|
|
|
wineWowPackages.waylandFull
|
2023-07-12 05:54:40 +02:00
|
|
|
];
|
2023-07-12 08:34:24 +02:00
|
|
|
}
|