Guest User

configuration.nix

a guest
Oct 9th, 2025
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.81 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. { config, pkgs, ... }:
  5.  
  6. let
  7. oldPkgs = import (fetchTarball {
  8. url = "https://channels.nixos.org/nixos-24.11/nixexprs.tar.xz";
  9. }) { config.allowUnfree = true; };
  10. in {
  11. # boot.kernelPackages = oldPkgs.linuxPackages_6_16;
  12. imports =
  13. [ # Include the results of the hardware scan.
  14. ./hardware-configuration.nix
  15. ];
  16.  
  17. # Allow unfree packages
  18. nixpkgs.config.allowUnfree = true;
  19. nix.settings.experimental-features = [ "nix-command" "flakes" ];
  20.  
  21. # Bootloader.
  22. boot.loader.systemd-boot.enable = true;
  23. boot.loader.efi.canTouchEfiVariables = true;
  24. boot.kernelPackages = pkgs.linuxPackages_6_16;
  25.  
  26. networking.hostName = "nixos"; # Define your hostname.
  27. #networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
  28.  
  29. # Configure network proxy if necessary
  30. # networking.proxy.default = "http://user:password@proxy:port/";
  31. # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
  32.  
  33. # Enable networking
  34. networking.networkmanager.enable = true;
  35.  
  36. # Set your time zone.
  37. time.timeZone = "Europe/Samara";
  38.  
  39. # Select internationalisation properties.
  40. i18n.defaultLocale = "en_US.UTF-8";
  41.  
  42. i18n.extraLocaleSettings = {
  43. LC_ADDRESS = "ru_RU.UTF-8";
  44. LC_IDENTIFICATION = "ru_RU.UTF-8";
  45. LC_MEASUREMENT = "ru_RU.UTF-8";
  46. LC_MONETARY = "ru_RU.UTF-8";
  47. LC_NAME = "ru_RU.UTF-8";
  48. LC_NUMERIC = "ru_RU.UTF-8";
  49. LC_PAPER = "ru_RU.UTF-8";
  50. LC_TELEPHONE = "ru_RU.UTF-8";
  51. LC_TIME = "ru_RU.UTF-8";
  52. };
  53.  
  54. # Enable the X11 windowing system.
  55. # services.xserver.enable = false;
  56.  
  57. # Enable the GNOME Desktop Environment.
  58. services.xserver.displayManager.gdm.enable = true;
  59. services.xserver.desktopManager.gnome.enable = false;
  60.  
  61. # Configure keymap in X11
  62. services.xserver = {
  63. enable = true;
  64. layout = "us,ru";
  65. xkbOptions = "grp:alt_shift_toggle";
  66. };
  67. programs.hyprland = {
  68. # Install the packages from nixpkgs
  69. enable = true;
  70. # Whether to enable XWayland
  71. xwayland.enable = true;
  72. };
  73.  
  74. # Enable CUPS to print documents.
  75. services.printing.enable = true;
  76.  
  77. # Enable sound with pipewire.
  78. services.pulseaudio.enable = false;
  79. security.rtkit.enable = true;
  80. services.pipewire = {
  81. enable = true;
  82. alsa.enable = true;
  83. alsa.support32Bit = true;
  84. pulse.enable = true;
  85. # If you want to use JACK applications, uncomment this
  86. #jack.enable = true;
  87.  
  88. # use the example session manager (no others are packaged yet so this is enabled by default,
  89. # no need to redefine it in your config for now)
  90. #media-session.enable = true;
  91. };
  92.  
  93. services.v2raya.enable = true;
  94.  
  95. # Enable touchpad support (enabled default in most desktopManager).
  96. # services.xserver.libinput.enable = true;
  97.  
  98. # Define a user account. Don't forget to set a password with ‘passwd’.
  99. users.users.aiko = {
  100. isNormalUser = true;
  101. description = "Aiko";
  102. extraGroups = [ "networkmanager" "wheel" ];
  103. packages = with pkgs; [
  104. # thunderbird
  105. ];
  106. };
  107.  
  108. # Install firefox.
  109. programs.firefox.enable = true;
  110.  
  111. # List packages installed in system profile. To search, run:
  112. # $ nix search wget
  113. environment.systemPackages = with pkgs; [
  114. # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
  115. wget
  116. git
  117. waybar
  118. alacritty
  119. rofi
  120. flameshot
  121. hyprpaper
  122. home-manager
  123.  
  124. #Apps
  125. obs-studio
  126. obsidian
  127. pavucontrol
  128. telegram-desktop
  129. vesktop
  130. steam
  131. google-chrome
  132.  
  133. htop
  134. pciutils
  135. ];
  136.  
  137.  
  138. services.xserver.videoDrivers = [ "modesetting" "nvidia" ];
  139.  
  140. hardware.opengl = {
  141. enable = true;
  142. };
  143.  
  144. hardware.nvidia = {
  145. modesetting.enable = true;
  146. powerManagement.enable = true;
  147. open = false;
  148. nvidiaSettings = true;
  149.  
  150.  
  151. package = config.boot.kernelPackages.nvidiaPackages.legacy_535; #(old: {
  152. #version = "535.171.04";
  153. #src = pkgs.fetchurl {
  154. # url = "https://us.download.nvidia.com/XFree86/Linux-x86_64/535.171.04/NVIDIA-Linux-x86_64-535.171.04.run";
  155. #sha256 = "0yj38aljmnr0c533d4hl5xjf9b3xm620fix4cp6qlpf99cxn9wg8";
  156. #};
  157. #});
  158. };
  159.  
  160. boot.kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ];
  161. boot.kernelParams = [ "nvidia-drm.modeset=1" ];
  162.  
  163. # Enable OpenGL
  164. hardware.graphics = {
  165. enable = true;
  166. };
  167. # Prime
  168. hardware.nvidia.prime = {
  169. offload = {
  170. enable = true;
  171. enableOffloadCmd = true;
  172. };
  173. intelBusId = "PCI:0:2:0";
  174. nvidiaBusId = "PCI:1:0:0";
  175. };
  176.  
  177. # Some programs need SUID wrappers, can be configured further or are
  178. # started in user sessions.
  179. # programs.mtr.enable = true;
  180. # programs.gnupg.agent = {
  181. # enable = true;
  182. # enableSSHSupport = true;
  183. # };
  184.  
  185. # List services that you want to enable:
  186.  
  187. # Enable the OpenSSH daemon.
  188. # services.openssh.enable = true;
  189.  
  190. # Open ports in the firewall.
  191. # networking.firewall.allowedTCPPorts = [ ... ];
  192. # networking.firewall.allowedUDPPorts = [ ... ];
  193. # Or disable the firewall altogether.
  194. # networking.firewall.enable = false;
  195.  
  196. # This value determines the NixOS release from which the default
  197. # settings for stateful data, like file locations and database versions
  198. # on your system were taken. It‘s perfectly fine and recommended to leave
  199. # this value at the release version of the first install of this system.
  200. # Before changing this value read the documentation for this option
  201. # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  202. system.stateVersion = "25.05"; # Did you read the comment?
  203.  
  204. }
  205.  
  206.  
Advertisement
Add Comment
Please, Sign In to add comment