Guest User

configuration.nix

a guest
Nov 13th, 2025
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.72 KB | None | 0 0
  1. { inputs
  2. , outputs
  3. , lib
  4. , config
  5. , pkgs
  6. , ...
  7. }: {
  8. imports = [
  9. ./hardware-configuration.nix
  10. ];
  11.  
  12. nixpkgs = {
  13. overlays = [
  14. outputs.overlays.additions
  15. outputs.overlays.modifications
  16. outputs.overlays.unstable-packages
  17. ];
  18.  
  19. config = {
  20. allowUnfree = true;
  21. };
  22. };
  23.  
  24. # This will add each flake input as a registry
  25. # To make nix3 commands consistent with the flake
  26. nix.registry = (lib.mapAttrs (_: flake: { inherit flake; })) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
  27.  
  28. # Weekly garbage collection
  29. nix.gc = {
  30. automatic = true;
  31. dates = "weekly";
  32. };
  33.  
  34. # This will additionally add inputs to the system's legacy channels
  35. # Making legacy nix commands consistent as well, awesome!
  36. nix.nixPath = [ "/etc/nix/path" ];
  37. environment.etc =
  38. lib.mapAttrs'
  39. (name: value: {
  40. name = "nix/path/${name}";
  41. value.source = value.flake;
  42. })
  43. config.nix.registry;
  44.  
  45. nix.settings = {
  46. experimental-features = "nix-command flakes";
  47. auto-optimise-store = true;
  48. };
  49.  
  50. environment.systemPackages = with pkgs; [
  51. vim
  52. wget
  53. ];
  54.  
  55. programs = {
  56. firefox.enable = true;
  57. direnv = {
  58. enable = true;
  59. nix-direnv.enable = true;
  60. };
  61. gnupg.agent = {
  62. enable = true;
  63. enableSSHSupport = true;
  64. };
  65. };
  66.  
  67.  
  68. # Bootloader.
  69. boot.loader.systemd-boot.enable = true;
  70. boot.loader.systemd-boot.configurationLimit = 10;
  71. boot.loader.efi.canTouchEfiVariables = true;
  72.  
  73. # Bluetooth
  74. hardware.bluetooth.enable = true;
  75. hardware.bluetooth.powerOnBoot = true;
  76.  
  77. networking.hostName = "nixos";
  78. # Enable networking
  79. networking.networkmanager.enable = true;
  80. # Set your time zone.
  81. time.timeZone = "Europe/Berlin";
  82.  
  83. # Select internationalisation properties.
  84. i18n.defaultLocale = "en_US.UTF-8";
  85. i18n.extraLocaleSettings = {
  86. LC_ADDRESS = "de_DE.UTF-8";
  87. LC_IDENTIFICATION = "de_DE.UTF-8";
  88. LC_MEASUREMENT = "de_DE.UTF-8";
  89. LC_MONETARY = "de_DE.UTF-8";
  90. LC_NAME = "de_DE.UTF-8";
  91. LC_NUMERIC = "de_DE.UTF-8";
  92. LC_PAPER = "de_DE.UTF-8";
  93. LC_TELEPHONE = "de_DE.UTF-8";
  94. LC_TIME = "de_DE.UTF-8";
  95. };
  96.  
  97.  
  98. # Configure X11. Switch to Hyprland later
  99. services.xserver = {
  100. enable = true;
  101. xkb.layout = "us";
  102. xkb.variant = "";
  103. };
  104. services.displayManager.sddm.enable = true;
  105. services.desktopManager.plasma6.enable = true;
  106.  
  107. # Enable CUPS to print documents.
  108. services.printing.enable = true;
  109.  
  110. # Enable sound with pipewire.
  111. services.pulseaudio.enable = false;
  112. security.rtkit.enable = true;
  113. services.pipewire = {
  114. enable = true;
  115. alsa.enable = true;
  116. alsa.support32Bit = true;
  117. pulse.enable = true;
  118. };
  119.  
  120. # Virtualisation
  121. #virtualisation.libvirtd.enable = true;
  122. virtualisation.virtualbox.host.enable = true;
  123. users.extraGroups.vboxusers.members = [ "klucas" ];
  124. virtualisation.virtualbox.host.enableExtensionPack = true;
  125. virtualisation.virtualbox.guest.enable = true;
  126. virtualisation.virtualbox.guest.dragAndDrop = true;
  127.  
  128. # User account
  129. users.users.klucas = {
  130. isNormalUser = true;
  131. description = "Kevin Lucas";
  132. extraGroups = [ "networkmanager" "wheel" "vboxusers" "vboxsf" ];
  133. shell = pkgs.zsh;
  134. };
  135. programs.zsh.enable = true;
  136.  
  137. # TODO: Move to a separate module
  138. fonts.packages = with pkgs; [
  139. source-sans
  140. source-serif
  141. nerd-fonts.sauce-code-pro
  142. nerd-fonts.fira-code
  143. nerd-fonts.droid-sans-mono
  144. ];
  145.  
  146. fonts.fontconfig = {
  147. enable = true;
  148. defaultFonts = {
  149. serif = [ "Source Serif 4" ];
  150. sansSerif = [ "Source Sans 3" ];
  151. monospace = [ "Fira Code" ];
  152. };
  153. };
  154.  
  155. system.stateVersion = "23.11";
  156. }
  157.  
Advertisement
Add Comment
Please, Sign In to add comment