salvoza

configure.nix

Sep 7th, 2024
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.06 KB | None | 0 0
  1. salvo@nixos:~/.dotfiles/ > cat configuration.nix
  2. # Edit this configuration file to define what should be installed on
  3. # your system. Help is available in the configuration.nix(5) man page
  4. # and in the NixOS manual (accessible by running ‘nixos-help’).
  5.  
  6. # Rebuild from
  7. # /home/salvo/.dotfiles
  8. # nix flake update
  9. # sudo nixos-rebuild switch --flake .
  10. # home-manager switch --flake .
  11.  
  12. { config, lib, inputs, pkgs, ... }:
  13.  
  14. {
  15. imports =
  16. [ # Include the results of the hardware scan.
  17. ./hardware-configuration.nix
  18. ];
  19.  
  20. boot.loader = {
  21. efi.canTouchEfiVariables = true;
  22. grub = {
  23. enable = true;
  24. devices = [ "nodev" ];
  25. efiSupport = true;
  26. useOSProber = true;
  27. };
  28. };
  29.  
  30. networking.hostName = "nixos"; # Define your hostname.
  31. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
  32.  
  33. # Configure network proxy if necessary
  34. # networking.proxy.default = "http://user:password@proxy:port/";
  35. # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
  36.  
  37. # Enable networking
  38. networking.networkmanager.enable = true;
  39.  
  40. # Set your time zone.
  41. time.timeZone = "Europe/London";
  42.  
  43. # Select internationalisation properties.
  44. i18n.defaultLocale = "en_GB.UTF-8";
  45.  
  46. i18n.extraLocaleSettings = {
  47. LC_ADDRESS = "en_GB.UTF-8";
  48. LC_IDENTIFICATION = "en_GB.UTF-8";
  49. LC_MEASUREMENT = "en_GB.UTF-8";
  50. LC_MONETARY = "en_GB.UTF-8";
  51. LC_NAME = "en_GB.UTF-8";
  52. LC_NUMERIC = "en_GB.UTF-8";
  53. LC_PAPER = "en_GB.UTF-8";
  54. LC_TELEPHONE = "en_GB.UTF-8";
  55. LC_TIME = "en_GB.UTF-8";
  56. };
  57.  
  58. nixpkgs.config.nvidia.acceptLicense = true;
  59.  
  60. services.xserver.videoDrivers = [ "nvidia" ];
  61.  
  62. # hyprland
  63. programs.hyprland.enable = true;
  64. #programs.hyprland.package = inputs.hyprland.packages."${pkgs.system}".hyprland;
  65.  
  66.  
  67. # enable crontab
  68. services.cron.enable = true;
  69.  
  70. #Flakes
  71. nix.settings.experimental-features = [ "nix-command" " flakes" ];
  72.  
  73. environment.variables = {
  74. GBM_BACKEND = "nvidia-drm";
  75. LIBVA_DRIVER_NAME = "nvidia";
  76. __GLX_VENDOR_LIBRARY_NAME = "nvidia";
  77. };
  78.  
  79. hardware = {
  80. nvidia = {
  81. modesetting.enable = true;
  82. powerManagement.enable = true;
  83. package = config.boot.kernelPackages.nvidiaPackages.latest;
  84. nvidiaSettings = true;
  85. powerManagement.finegrained = false;
  86. };
  87. opengl = {
  88. enable = true;
  89. driSupport = true;
  90. driSupport32Bit = true;
  91. extraPackages = with pkgs; [
  92. nvidia-vaapi-driver
  93. vaapiVdpau
  94. libvdpau-va-gl
  95. ];
  96. };
  97. };
  98.  
  99. services.xserver.enable = true;
  100.  
  101. # Enable the KDE Plasma Desktop Environment.
  102. services.displayManager.sddm.enable = true;
  103. services.desktopManager.plasma6.enable = true;
  104.  
  105. # Configure keymap in X11
  106. services.xserver.xkb = {
  107. layout = "us";
  108. variant = "";
  109. };
  110.  
  111. # Enable CUPS to print documents.
  112. services.printing.enable = true;
  113.  
  114. # Enable Bluetooth
  115. hardware.bluetooth.enable = true;
  116. hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot
  117.  
  118. # Enable sound with pipewire.
  119. hardware.pulseaudio.enable = false;
  120. security.rtkit.enable = true;
  121.  
  122. services.pipewire = {
  123. enable = true;
  124. alsa.enable = true;
  125. alsa.support32Bit = true;
  126. pulse.enable = true;
  127. # If you want to use JACK applications, uncomment this
  128. #jack.enable = true;
  129.  
  130. # use the example session manager (no others are packaged yet so this is enabled by default,
  131. # no need to redefine it in your config for now)
  132. #media-session.enable = true;
  133. };
  134.  
  135. # Enable touchpad support (enabled default in most desktopManager).
  136. # services.xserver.libinput.enable = true;
  137.  
  138. # Define a user account. Don't forget to set a password with ‘passwd’.
  139. users.users.salvo = {
  140. isNormalUser = true;
  141. description = "Salvatore Greco";
  142. extraGroups = [ "networkmanager" "wheel" ];
  143. packages = with pkgs; [
  144. kdePackages.kate
  145. # thunderbird
  146. ];
  147. };
  148.  
  149. # Install firefox.
  150. programs.firefox.enable = true;
  151.  
  152. # Allow unfree packages
  153. nixpkgs.config.allowUnfree = true;
  154. nixpkgs.config.allowInsecure = true;
  155.  
  156. # Steam
  157. programs.steam.enable = true;
  158. programs.steam.gamescopeSession.enable = true;
  159. programs.gamemode.enable = true;
  160.  
  161.  
  162. # Commented this out for now
  163. # programs.steam.protontricks.enable = true;
  164.  
  165.  
  166. environment.sessionVariables = {
  167. STEAM_EXTRA_COMPAT_TOOLS_PATHS =
  168. "\${HOME}/.steam/root/compatibilitytools.d";
  169. };
  170.  
  171. # I use zsh btw
  172. environment.shells = with pkgs; [ zsh ];
  173. users.defaultUserShell = pkgs.zsh;
  174. programs.zsh.enable = true;
  175.  
  176. # List packages installed in system profile. To search, run:
  177. # $ nix search wget
  178. environment.systemPackages = with pkgs; [
  179. vim
  180. brave
  181. pkgs.obsidian
  182. pkgs._1password-gui
  183. pkgs.neofetch
  184. pkgs.telegram-desktop
  185. pkgs.whatsapp-for-linux
  186. pkgs.teams-for-linux
  187. pkgs.discord
  188. pkgs.freetube
  189. mangohud
  190. protonup
  191. pkgs.neovim
  192. restic
  193. # nvidia-vaapi-driver
  194. # vaapiVdpau
  195. libvdpau-va-gl
  196. kitty
  197. alacritty
  198. git
  199. git-crypt
  200. gnupg
  201. btop
  202. pkgs.jetbrains-mono
  203. pkgs.qemu # Virtual machine software
  204. pkgs.virt-manager # virtual manager
  205. pkgs.ckb-next # iCUE like driver for mouse
  206. #pkgs.cameractrls-gtk4
  207. vulkan-loader
  208. vulkan-validation-layers
  209. vulkan-tools
  210. ];
  211.  
  212.  
  213. fonts.packages = with pkgs; [
  214. cifs-utils
  215. corefonts
  216. dina-font
  217. fira-code
  218. fira-code-symbols
  219. font-awesome
  220. jetbrains-mono
  221. liberation_ttf
  222. mplus-outline-fonts.githubRelease
  223. nerdfonts
  224. noto-fonts
  225. noto-fonts-cjk
  226. noto-fonts-emoji
  227. noto-fonts-extra
  228. powerline-fonts
  229. proggyfonts
  230. ubuntu_font_family
  231. unifont
  232. unifont_upper
  233. ];
  234.  
  235.  
  236. # Some programs need SUID wrappers, can be configured further or are
  237. # started in user sessions.
  238. # programs.mtr.enable = true;
  239. # programs.gnupg.agent = {
  240. # enable = true;
  241. # enableSSHSupport = true;
  242. # };
  243.  
  244. # List services that you want to enable:
  245.  
  246. # Enable the OpenSSH daemon.
  247. # services.openssh.enable = true;
  248.  
  249. # Open ports in the firewall.
  250. # networking.firewall.allowedTCPPorts = [ ... ];
  251. # networking.firewall.allowedUDPPorts = [ ... ];
  252. # Or disable the firewall altogether.
  253. # networking.firewall.enable = false;
  254.  
  255. # This value determines the NixOS release from which the default
  256. # settings for stateful data, like file locations and database versions
  257. # on your system were taken. It‘s perfectly fine and recommended to leave
  258. # this value at the release version of the first install of this system.
  259. # Before changing this value read the documentation for this option
  260. # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  261. system.stateVersion = "24.05"; # Did you read the comment?
  262.  
  263. }
Tags: nixos
Add Comment
Please, Sign In to add comment