···11+{ pkgs, ... }:
22+33+{
44+ imports = [
55+ ./nvidia.nix
66+ ];
77+88+ # For hardware acceleration
99+ environment.sessionVariables.LIBVA_DRIVER_NAME = "iHD";
1010+1111+ # Enable OpenGL
1212+ hardware.graphics = {
1313+ enable = true;
1414+ extraPackages = with pkgs; [
1515+ # Used for hardware-acceleration
1616+ intel-media-driver # For Broadwell (2014) or newer processors. LIBVA_DRIVER_NAME=iHD
1717+ ];
1818+ };
1919+}
+15
modules/hardware/graphics/nvidia.nix
···11+{ ... }:
22+33+{
44+ hardware.nvidia = {
55+ # Required
66+ modesetting.enable = true;
77+ # Use closed-source drivers
88+ open = false;
99+ # Enable the Nvidia settings menu
1010+ nvidiaSettings = true;
1111+ };
1212+1313+ # Load Nvidia driver for Xorg and Wayland
1414+ services.xserver.videoDrivers = [ "nvidia" ];
1515+}
+10
modules/steam.nix
···11+{ ... }:
22+33+{
44+ programs.steam = {
55+ enable = true;
66+ remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
77+ dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
88+ localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
99+ };
1010+}
···11#!/usr/bin/env sh
2233+# Accepts all arguments to nh os switch
44+# For example --ask to prompt if the user want to switch configs
55+36# Rebuild and switch the environment if successful
47git add .
58./fmt
66-nh os switch .
99+nh os switch . "$@"