/ configuration.nix
configuration.nix
  1  # Edit this configuration file to define what should be installed on your system.  Help is available in the configuration.nix(5) man page and in the
  2  # NixOS manual (accessible by running ‘nixos-help’).
  3  
  4  { config, pkgs, lib, ... }: {
  5    imports = [
  6      # Include the results of the hardware scan.
  7      ./hardware-configuration.nix
  8    ];
  9  
 10    # Bootloader.
 11    boot.loader.grub.enable = true;
 12    boot.loader.grub.efiSupport = true;
 13    boot.loader.grub.efiInstallAsRemovable = true;
 14    boot.loader.grub.device = "nodev";
 15    boot.loader.grub.useOSProber = false;
 16    boot.initrd.kernelModules = [ "pinctrl_tigerlake" ];
 17  
 18    networking.hostName = "krebmachine"; # Define your hostname.
 19    # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
 20    # dns
 21    networking.nameservers = [ "8.8.8.8" "1.1.1.1" ];
 22    networking.networkmanager.dns = "none";
 23  
 24    # Configure network proxy if necessary networking.proxy.default = "http://user:password@proxy:port/"; networking.proxy.noProxy =
 25    # "127.0.0.1,localhost,internal.domain";
 26  
 27    # Enable networking
 28    networking.networkmanager.enable = true;
 29  
 30    # Wayland settings
 31    services.xserver.enable = true;
 32    programs.xwayland.enable = true;
 33  
 34    # Window Manager
 35    services.xserver.windowManager.i3.enable = true;
 36    # services.xserver.desktopManager.xfce.enable = true;
 37    programs.niri.enable = true;
 38  
 39    # Display Manager
 40    services.displayManager.defaultSession = "niri";
 41    # services.xserver.displayManager.lightdm.enable = true;
 42    # services.displayManager.sddm.enable = true;
 43    # services.displayManager.sddm.wayland.enable = true;
 44    services.displayManager.ly = {
 45      enable = true;
 46      settings = {
 47        load = true;
 48        save = true;
 49        hide_key_hints = true;
 50        hide_version_string = true;
 51        full_color = true;
 52      };
 53    };
 54  
 55    # Session Variables
 56    environment.sessionVariables = {
 57      XDG_SESSION_TYPE = "wayland";
 58      XDG_CURRENT_DESKTOP = "KDE";
 59      XDG_SESSION_DESKTOP = "niri";
 60      WAYLAND_DISPLAY = "wayland-0";
 61    };
 62  
 63    # Set your time zone.
 64    # time.timeZone = "Australia/Brisbane";
 65    time.timeZone = "Asia/Kuala_Lumpur";
 66  
 67    # Select internationalisation properties.
 68    i18n.defaultLocale = "en_AU.UTF-8";
 69  
 70    i18n.extraLocaleSettings = {
 71      LC_ADDRESS = "en_AU.UTF-8";
 72      LC_IDENTIFICATION = "en_AU.UTF-8";
 73      LC_MEASUREMENT = "en_AU.UTF-8";
 74      LC_MONETARY = "en_AU.UTF-8";
 75      LC_NAME = "en_AU.UTF-8";
 76      LC_NUMERIC = "en_AU.UTF-8";
 77      LC_PAPER = "en_AU.UTF-8";
 78      LC_TELEPHONE = "en_AU.UTF-8";
 79      LC_TIME = "en_AU.UTF-8";
 80    };
 81  
 82    # Configure keymap in X11
 83    services.xserver.xkb = {
 84      layout = "au";
 85      variant = "";
 86    };
 87  
 88    programs.fish.enable = true;
 89    users.users.mrkrebs.shell = pkgs.bash;
 90  
 91    # Define a user account. Don't forget to set a password with ‘passwd’.
 92    users.users.mrkrebs = {
 93      isNormalUser = true;
 94      description = "mrkrebs";
 95      extraGroups = [ "networkmanager" "wheel" "dialout" "video" ];
 96      packages = with pkgs; [ ];
 97    };
 98  
 99    # Allow unfree packages
100    nixpkgs.config.allowUnfree = true;
101  
102    # List packages installed in system profile. To search, run: $ nix search wget
103    environment.systemPackages = with pkgs; [
104      # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
105      wget
106      light
107      git
108      mangohud
109      pkg-config
110      glib
111      glib.dev
112      gtk3.dev
113      pango.dev
114      cairo.dev
115      gdk-pixbuf
116      vim
117      curl
118      niri
119      zip
120      brightnessctl
121      unzip
122      bluez
123      p7zip
124      unrar
125      rar
126      gnutar
127      iproute2
128      gcc
129      unixtools.ping
130      plymouth
131      parted
132      xwayland-satellite
133      xbindkeys
134      xdg-utils
135      xbindkeys-config
136      nnn
137      pcmanfm
138      nautilus
139      wineWow64Packages.full
140    ];
141  
142    # Some programs need SUID wrappers, can be configured further or are started in user sessions. programs.mtr.enable = true; programs.gnupg.agent = {
143    #   enable = true; enableSSHSupport = true;
144    # };
145  
146    # List services that you want to enable:
147  
148    # Enable the OpenSSH daemon. services.openssh.enable = true;
149  
150    # Open ports in the firewall. networking.firewall.allowedTCPPorts = [ ... ]; networking.firewall.allowedUDPPorts = [ ... ]; Or disable the firewall
151    # altogether. networking.firewall.enable = false;
152  
153    # This value determines the NixOS release from which the default settings for stateful data, like file locations and database versions on your system
154    # were taken. It‘s perfectly fine and recommended to leave this value at the release version of the first install of this system. Before changing this
155    # value read the documentation for this option (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
156    system.stateVersion = "25.05"; # Did you read the comment?
157  
158    # Enable flakes
159    nix.settings.experimental-features = [ "nix-command" "flakes" ];
160  
161    # Plymouth module, check available themes at https://github.com/adi1090x/plymouth-themes
162    boot.plymouth = {
163      enable = true;
164      themePackages = [ pkgs.adi1090x-plymouth-themes ];
165      theme = "circuit";
166    };
167  
168    # Nix Garbage Collection. Remove old system generations
169    nix.gc = {
170      automatic = true;
171      dates = "weekly";
172      options = "--delete-older-than 7d";
173    };
174  
175    # Enable Flatpak
176    services.flatpak.enable = true;
177  
178    # Enable auto-cpufreq to save battery
179    services.auto-cpufreq.enable = true;
180    services.power-profiles-daemon.enable = false;
181  
182    # Bluetooth
183    hardware.bluetooth = {
184      enable = true;
185      powerOnBoot = true;
186    };
187  
188    # Mime
189    xdg.mime.enable = true;
190    xdg.menus.enable = true;
191  
192    # Steam Enable with GameScope
193    programs.steam = {
194      enable = true;
195      gamescopeSession.enable = true;
196      remotePlay.openFirewall = true;
197      dedicatedServer.openFirewall = true;
198      localNetworkGameTransfers.openFirewall = true;
199    };
200    programs.gamescope = {
201      enable = true;
202      capSysNice = true;
203    };
204    hardware =
205      {
206        graphics = {
207          enable = true;
208          enable32Bit = true;
209        };
210      };
211  
212    # Running non-Nix binaries with dynamic linking
213    programs.nix-ld.enable = true;
214  
215    # Allow brightnessctl be run by anyone
216    security.sudo.enable = true;
217    services.udev.extraRules = ''
218      ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", MODE="0666", RUN+="${pkgs.coreutils}/bin/chmod a+w /sys/class/backlight/%k/brightness"
219    '';
220  
221    # Framework 12 with intel settings
222    services.fwupd.enable = true;
223    services.fwupd.extraRemotes = [ "lvfs-testing" ];
224    services.fwupd.uefiCapsuleSettings.DisableCapsuleUpdateOnDisk = true;
225  
226    # Enable docker
227    virtualisation.docker = {
228      enable = true;
229      rootless = {
230        enable = true;
231        setSocketVariable = true;
232      };
233    };
234  
235    # Enable Virtualbox as host
236    virtualisation.virtualbox.host.enable = true;
237    virtualisation.virtualbox.host.enableKvm = true;
238    virtualisation.virtualbox.host.addNetworkInterface = false;
239  }