nix/hosts/nixos-laptop/nixos/configuration.nix
2023-08-19 17:28:54 +09:00

108 lines
2.7 KiB
Nix

{ lib, config, pkgs, ... }: {
imports = [
# Desktop Environments
../../../desktops/common.nix
../../../desktops/hyprland.nix
# Power Mamagement
../../../modules/powertop.nix
];
# Set and enable TLP
services.tlp = {
enable = true;
};
programs.gamemode = {
enable = true;
settings = {
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
};
};
};
# Try thinkfan...
services.thinkfan = {
enable = true;
};
# 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
# https://libreddit.kavin.rocks/r/NixOS/comments/x04dyv/optimus_help/
# boot.kernelParams = [ "nomodeset" ];
# nVidia information:
# https://github.com/NixOS/nixpkgs/pull/211300
# https://github.com/NixOS/nixpkgs/pull/244060
hardware = {
opengl.enable = true;
opengl.driSupport32Bit = true;
opengl.driSupport = true;
# opengl.extraPackages = with pkgs; [ nvidia-vaapi-driver ];
# https://nixpk.gs/pr-tracker.html?pr=244060
nvidia = {
open = false;
dynamicBoost.enable = true;
nvidiaPersistenced = false;
package = config.boot.kernelPackages.nvidiaPackages.stable;
powerManagement.finegrained = true;
powerManagement.enable = true;
nvidiaSettings = true;
modesetting.enable = true;
prime = {
reverseSync = true;
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 graphics options
vulkan-loader
vulkan-validation-layers
vulkan-tools
gwe
nvtop-nvidia
# Game related things
gamemode
# support both 32- and 64-bit applications
wineWowPackages.stable
# wine-staging (version with experimental features)
# wineWowPackages.staging
# winetricks (all versions)
winetricks
# native wayland support (unstable)
wineWowPackages.waylandFull
];
}