Advertisement
reaperhacknslash

configuration.nix (nvidia)

May 29th, 2024 (edited)
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.10 KB | None | 0 0
  1. # Edit this configuration file to define what should be installed on
  2. # your system. Help is available in the configuration.nix(5) man page
  3. # and in the NixOS manual (accessible by running ‘nixos-help’).
  4.  
  5. { config, pkgs, ... }:
  6.  
  7. {
  8. imports =
  9. [ # Include the results of the hardware scan.
  10. ./hardware-configuration.nix
  11. ];
  12.  
  13. # nVidia Non-Free Beta
  14.  
  15. # Enable OpenGL
  16. hardware.opengl = {
  17. enable = true;
  18. driSupport = true;
  19. driSupport32Bit = true;
  20. };
  21.  
  22. # Load nvidia driver for Xorg and Wayland
  23. services.xserver.videoDrivers = ["nvidia"];
  24. # boot.kernelParams = ["nvidia-drm.fbdev=1"];
  25.  
  26. hardware.nvidia = {
  27.  
  28. # Modesetting is required.
  29. modesetting.enable = true;
  30.  
  31. # Nvidia power management. Experimental, and can cause sleep/suspend to fail.
  32. # Enable this if you have graphical corruption issues or application crashes after waking
  33. # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
  34. # of just the bare essentials.
  35. powerManagement.enable = false;
  36.  
  37. # Fine-grained power management. Turns off GPU when not in use.
  38. # Experimental and only works on modern Nvidia GPUs (Turing or newer).
  39. powerManagement.finegrained = false;
  40.  
  41. # Use the NVidia open source kernel module (not to be confused with the
  42. # independent third-party "nouveau" open source driver).
  43. # Support is limited to the Turing and later architectures. Full list of
  44. # supported GPUs is at:
  45. # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
  46. # Only available from driver 515.43.04+
  47. # Currently alpha-quality/buggy, so false is currently the recommended setting.
  48. open = false;
  49.  
  50. # Enable the Nvidia settings menu,
  51. # accessible via `nvidia-settings`.
  52. nvidiaSettings = true;
  53.  
  54. # Optionally, you may need to select the appropriate driver version for your specific GPU.
  55. package = config.boot.kernelPackages.nvidiaPackages.beta;
  56. };
  57.  
  58. # Bootloader.
  59. boot.kernelPackages = pkgs.linuxPackages_latest;
  60. boot.loader.systemd-boot.enable = true;
  61. boot.loader.efi.canTouchEfiVariables = true;
  62.  
  63. networking.hostName = "NixOS-Asus"; # Define your hostname.
  64. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
  65.  
  66. # Configure network proxy if necessary
  67. # networking.proxy.default = "http://user:password@proxy:port/";
  68. # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
  69.  
  70. # Enable networking
  71. networking.networkmanager.enable = true;
  72. # Steam Configuration
  73. programs.steam = {
  74. enable = true;
  75. package = with pkgs; steam.override { extraPkgs = pkgs: [ attr ]; };
  76. };
  77. # Set your time zone.
  78. time.timeZone = "America/Moncton";
  79. time.hardwareClockInLocalTime = true;
  80. # Select internationalisation properties.
  81. i18n.defaultLocale = "en_CA.UTF-8";
  82.  
  83. # Enable the X11 windowing system.
  84. services.xserver.enable = true;
  85.  
  86. # Enable the KDE Plasma Desktop Environment.
  87. services.xserver.displayManager.sddm.enable = true;
  88. #services.xserver.desktopManager.plasma5.enable = true;
  89. # KDE Plasma 6 is now available on unstable
  90. services.desktopManager.plasma6.enable = true;
  91. # NixOS Auto Upgrade
  92. system.autoUpgrade.enable = true;
  93. system.autoUpgrade.allowReboot = true;
  94. # Configure keymap in X11
  95. services.xserver = {
  96. layout = "us";
  97. xkbVariant = "";
  98. };
  99.  
  100. # Enable CUPS to print documents.
  101. services.printing.enable = true;
  102.  
  103. # Enable sound with pipewire.
  104. sound.enable = true;
  105. hardware.pulseaudio.enable = false;
  106. security.rtkit.enable = true;
  107. services.pipewire = {
  108. enable = true;
  109. alsa.enable = true;
  110. alsa.support32Bit = true;
  111. pulse.enable = true;
  112. # If you want to use JACK applications, uncomment this
  113. #jack.enable = true;
  114.  
  115. # use the example session manager (no others are packaged yet so this is enabled by default,
  116. # no need to redefine it in your config for now)
  117. #media-session.enable = true;
  118. };
  119.  
  120. # Enable touchpad support (enabled default in most desktopManager).
  121. # services.xserver.libinput.enable = true;
  122.  
  123. # Define a user account. Don't forget to set a password with ‘passwd’.
  124. users.users.crypticexile = {
  125. isNormalUser = true;
  126. description = "crypticexile";
  127. extraGroups = [ "networkmanager" "wheel" "video" "render" ];
  128. packages = with pkgs; [
  129. kate
  130. # thunderbird
  131. ];
  132. };
  133.  
  134. # Install firefox.
  135. programs.firefox.enable = true;
  136.  
  137. # Allow unfree packages
  138. nixpkgs.config.allowUnfree = true;
  139. # Flatpak
  140. services.flatpak.enable = true;
  141. # List packages installed in system profile. To search, run:
  142. # $ nix search wget
  143. environment.systemPackages = with pkgs; [
  144. # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
  145. # wget
  146. discord
  147. cava
  148. obs-studio
  149. vlc
  150. steam
  151. gparted
  152. mc
  153. inxi
  154. kitty
  155. fastfetch
  156. git
  157. shotcut
  158. gimp
  159. deja-dup
  160. papirus-icon-theme
  161. ];
  162.  
  163. # Some programs need SUID wrappers, can be configured further or are
  164. # started in user sessions.
  165. # programs.mtr.enable = true;
  166. # programs.gnupg.agent = {
  167. # enable = true;
  168. # enableSSHSupport = true;
  169. # };
  170.  
  171. # List services that you want to enable:
  172.  
  173. # Enable the OpenSSH daemon.
  174. # services.openssh.enable = true;
  175.  
  176. # Open ports in the firewall.
  177. # networking.firewall.allowedTCPPorts = [ ... ];
  178. # networking.firewall.allowedUDPPorts = [ ... ];
  179. # Or disable the firewall altogether.
  180. # networking.firewall.enable = false;
  181.  
  182. # This value determines the NixOS release from which the default
  183. # settings for stateful data, like file locations and database versions
  184. # on your system were taken. It‘s perfectly fine and recommended to leave
  185. # this value at the release version of the first install of this system.
  186. # Before changing this value read the documentation for this option
  187. # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  188. system.stateVersion = "23.11"; # Did you read the comment?
  189.  
  190. }
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement