nix/hosts/nixos-laptop/configuration.nix

91 lines
2.2 KiB
Nix
Raw Normal View History

{ lib, config, pkgs, ... }: {
2023-07-01 17:23:32 +09:00
2023-07-13 18:08:12 +09:00
# Set your time zone.
time.timeZone = "Asia/Tokyo";
2023-07-06 12:24:21 +09:00
2023-07-01 18:37:30 +09:00
# Set the networking hostname:
2023-07-01 18:38:21 +09:00
networking.hostName = "nixos-laptop";
2023-07-01 18:37:30 +09:00
2023-07-01 17:23:32 +09:00
# Configure the fingerprint reader
services.fprintd = {
enable = true;
tod.enable = true;
tod.driver = pkgs.libfprint-2-tod1-vfs0090;
};
2023-07-05 21:58:58 +09:00
# Enable nVidia PRIME Render Offload and OpenGL
2023-07-01 17:23:32 +09:00
# https://github.com/NixOS/nixos-hardware/blob/master/lenovo/thinkpad/p1/3th-gen/nvidia.nix
2023-07-16 17:35:23 +09:00
# https://libreddit.kavin.rocks/r/NixOS/comments/x04dyv/optimus_help/
2023-07-16 18:22:22 +09:00
# boot.kernelParams = [ "nomodeset" ];
2023-07-16 17:35:23 +09:00
2023-07-26 21:42:33 +09:00
#
#
#
# nVidia information:
# https://github.com/NixOS/nixpkgs/pull/211300
# https://github.com/NixOS/nixpkgs/pull/244060
2023-07-05 21:58:58 +09:00
hardware = {
opengl.enable = true;
opengl.driSupport32Bit = true;
opengl.driSupport = true;
2023-07-16 17:35:23 +09:00
# opengl.extraPackages = with pkgs; [ nvidia-vaapi-driver ];
2023-08-11 21:23:00 +09:00
# https://nixpk.gs/pr-tracker.html?pr=244060
2023-08-14 19:56:10 +09:00
nvidia = {
2023-07-16 18:18:58 +09:00
open = false;
2023-08-15 10:10:15 +09:00
dynamicBoost.enable = true;
2023-07-16 17:06:08 +09:00
package = config.boot.kernelPackages.nvidiaPackages.stable;
2023-07-16 18:18:58 +09:00
# powerManagement.finegrained = true;
powerManagement.enable = true;
2023-08-15 10:10:15 +09:00
nvidiaSettings = true;
modesetting.enable = true;
2023-07-12 15:29:53 +09:00
prime = {
2023-07-14 23:59:52 +09:00
offload = {
enable = true;
enableOffloadCmd = true;
};
2023-07-12 15:29:53 +09:00
intelBusId = lib.mkDefault "PCI:0:2:0";
nvidiaBusId = lib.mkDefault "PCI:1:0:0";
};
2023-07-05 21:58:58 +09:00
};
2023-07-01 17:23:32 +09:00
};
2023-07-16 17:12:15 +09:00
# environment.variables = {
# GBM_BACKEND = "nvidia-drm";
# LIBVA_DRIVER_NAME = "nvidia";
# __GLX_VENDOR_LIBRARY_NAME = "nvidia";
# };
2023-07-12 23:41:12 +09:00
2023-07-26 21:42:33 +09:00
2023-07-12 12:54:40 +09:00
environment.systemPackages = with pkgs; [
2023-07-12 15:08:57 +09:00
# Fingerprint software
2023-07-12 12:54:40 +09:00
fprintd
2023-07-15 21:26:08 +09:00
# nVidia graphcis options
2023-07-15 22:31:06 +09:00
vulkan-loader
vulkan-validation-layers
vulkan-tools
2023-07-15 22:52:02 +09:00
gwe
2023-07-16 15:51:38 +09:00
2023-07-26 21:42:33 +09:00
# nvtop for use with nvidia cards
nvtop-nvidia
# Game related things
gamemode
2023-07-16 15:51:38 +09:00
# wine install
# support both 32- and 64-bit applications
wineWowPackages.stable
# support 32-bit only
2023-08-15 10:10:15 +09:00
# wine
2023-07-16 15:51:38 +09:00
# support 64-bit only
2023-07-16 17:08:34 +09:00
# (wine.override { wineBuild = "wine64"; })
2023-07-16 15:51:38 +09:00
# wine-staging (version with experimental features)
wineWowPackages.staging
# winetricks (all versions)
winetricks
# native wayland support (unstable)
wineWowPackages.waylandFull
2023-07-12 12:54:40 +09:00
];
2023-07-12 15:34:24 +09:00
}