nix/hosts/nixos-laptop/configuration.nix
2023-07-15 21:49:19 +09:00

53 lines
1.3 KiB
Nix

{ lib, config, pkgs, ... }: {
# Set your time zone.
time.timeZone = "Asia/Tokyo";
# Set the networking hostname:
networking.hostName = "nixos-laptop";
# Configure the fingerprint reader
services.fprintd = {
enable = true;
tod.enable = true;
tod.driver = pkgs.libfprint-2-tod1-vfs0090;
};
# Enable nVidia PRIME Render Offload and OpenGL
# https://github.com/NixOS/nixos-hardware/blob/master/lenovo/thinkpad/p1/3th-gen/nvidia.nix
hardware = {
opengl.enable = true;
opengl.driSupport32Bit = true;
opengl.driSupport = true;
# opengl.extraPackages = with pkgs; [ nvidia-vaapi-driver ];
nvidia = {
open = true;
powerManagement.enable = true;
modesetting.enable = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
intelBusId = lib.mkDefault "PCI:0:2:0";
nvidiaBusId = lib.mkDefault "PCI:1:0:0";
};
};
};
# environment.variables = {
# GBM_BACKEND = "nvidia-drm";
# LIBVA_DRIVER_NAME = "nvidia";
# __GLX_VENDOR_LIBRARY_NAME = "nvidia";
# };
environment.systemPackages = with pkgs; [
# Fingerprint software
fprintd
# nVidia graphcis options
# vulkan-loader
# vulkan-validation-layers
# vulkan-tools
];
}