nixos: gaming config
This commit is contained in:
parent
fe0166970e
commit
cf1813f3c0
|
@ -3,6 +3,12 @@
|
||||||
boot = {
|
boot = {
|
||||||
kernelPackages = pkgs.linuxPackages_latest;
|
kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
|
# Use the systemd-boot EFI boot loader.
|
||||||
|
loader = {
|
||||||
|
systemd-boot.enable = true;
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
|
||||||
initrd = {
|
initrd = {
|
||||||
verbose = false;
|
verbose = false;
|
||||||
systemd.enable = true;
|
systemd.enable = true;
|
||||||
|
|
|
@ -35,12 +35,9 @@ in
|
||||||
./nvidia.nix
|
./nvidia.nix
|
||||||
./boot.nix
|
./boot.nix
|
||||||
./home.nix
|
./home.nix
|
||||||
|
./gaming.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
|
|
||||||
# Nix package installer settings
|
# Nix package installer settings
|
||||||
nix = {
|
nix = {
|
||||||
settings = {
|
settings = {
|
||||||
|
@ -128,7 +125,6 @@ in
|
||||||
enableSSHSupport = true;
|
enableSSHSupport = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
steam.enable = true;
|
|
||||||
fish.enable = true;
|
fish.enable = true;
|
||||||
git = {
|
git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -148,6 +144,12 @@ in
|
||||||
# Enable the OpenSSH daemon.
|
# Enable the OpenSSH daemon.
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
# Enable fstrim for SSD
|
||||||
|
services.fstrim.enable = true;
|
||||||
|
|
||||||
|
# Hard disk protection if the laptop falls
|
||||||
|
services.hdapsd.enable = true;
|
||||||
|
|
||||||
# Open ports in the firewall.
|
# Open ports in the firewall.
|
||||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||||
|
|
22
nixos/msi/gaming.nix
Normal file
22
nixos/msi/gaming.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
mangohud
|
||||||
|
protonup
|
||||||
|
lutris
|
||||||
|
bottles
|
||||||
|
];
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
steam = {
|
||||||
|
enable = true;
|
||||||
|
gamescopeSession.enable = true;
|
||||||
|
};
|
||||||
|
gamemode.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.sessionVariables = {
|
||||||
|
# Tell protonup where to install patched proton GE
|
||||||
|
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "/home/kamov/.steam/root/compatibilitytools.d";
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,54 +1,54 @@
|
||||||
{ pkgs, config, libs, ... }:
|
{ pkgs, config, libs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
# Enable unfree packages
|
# Enable unfree packages
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
# Enable OpenGL
|
# Enable OpenGL
|
||||||
hardware.opengl = {
|
hardware.opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
driSupport = true;
|
driSupport = true;
|
||||||
driSupport32Bit = true;
|
driSupport32Bit = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Load nvidia driver for Xorg and Wayland
|
# Load nvidia driver for Xorg and Wayland
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
|
|
||||||
# Disable nouveau driver
|
# Disable nouveau driver
|
||||||
boot.blacklistedKernelModules = [ "nouveau" ];
|
boot.blacklistedKernelModules = [ "nouveau" ];
|
||||||
|
|
||||||
hardware.nvidia = {
|
hardware.nvidia = {
|
||||||
# Modesetting is required.
|
# Modesetting is required.
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
|
|
||||||
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
||||||
powerManagement.enable = false;
|
powerManagement.enable = false;
|
||||||
# Fine-grained power management. Turns off GPU when not in use.
|
# Fine-grained power management. Turns off GPU when not in use.
|
||||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
||||||
powerManagement.finegrained = false;
|
powerManagement.finegrained = false;
|
||||||
|
|
||||||
# Use the NVidia open source kernel module (not to be confused with the
|
# Use the NVidia open source kernel module (not to be confused with the
|
||||||
# independent third-party "nouveau" open source driver).
|
# independent third-party "nouveau" open source driver).
|
||||||
# Support is limited to the Turing and later architectures. Full list of
|
# Support is limited to the Turing and later architectures. Full list of
|
||||||
# supported GPUs is at:
|
# supported GPUs is at:
|
||||||
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
|
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
|
||||||
# Only available from driver 515.43.04+
|
# Only available from driver 515.43.04+
|
||||||
# Currently alpha-quality/buggy, so false is currently the recommended setting.
|
# Currently alpha-quality/buggy, so false is currently the recommended setting.
|
||||||
open = false;
|
open = false;
|
||||||
|
|
||||||
# Enable the Nvidia settings menu,
|
# Enable the Nvidia settings menu,
|
||||||
# accessible via `nvidia-settings`.
|
# accessible via `nvidia-settings`.
|
||||||
nvidiaSettings = true;
|
nvidiaSettings = true;
|
||||||
|
|
||||||
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||||
|
|
||||||
prime = {
|
prime = {
|
||||||
# Without this option set to true SDDM didn't want to start.
|
# Without this option set to true SDDM didn't want to start.
|
||||||
sync.enable = true;
|
sync.enable = true;
|
||||||
# Make sure to use the correct Bus ID values for your system!
|
# Make sure to use the correct Bus ID values for your system!
|
||||||
intelBusId = "PCI:0:2:0";
|
intelBusId = "PCI:0:2:0";
|
||||||
nvidiaBusId = "PCI:1:0:0";
|
nvidiaBusId = "PCI:1:0:0";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue