diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 8d776d7..432908e 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { # Imports @@ -12,6 +12,9 @@ ./modules/esync.nix ./modules/ryzenadj.nix ./modules/appimages.nix + ./modules/sddm.nix + ./modules/plasma.nix + ./modules/pipewire.nix ]; # Bootloader. @@ -57,84 +60,6 @@ LC_TIME = "hr_HR.UTF-8"; }; - # Enable the X11 windowing system. - services.xserver.enable = true; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - variant = ""; - options = "caps:escape"; - }; - - # Enable touchpad support - services.xserver.libinput.enable = true; - - # Enable sddm with catppuccin theme and fix virtual keyboard bug - services.displayManager.sddm = { - enable = true; - wayland.enable = true; - theme = "catppuccin-frappe"; - # Fix keyboard showing up unnecesarilly - settings = { - General = { InputMethod = ""; }; - # Setup nicer cursor theme - Theme = { CursorTheme = "Catppuccin-Frappe-Rosewater-Cursors"; }; - }; - }; - - # Setup plasma with excluding a couple unnecesarry packages - services.desktopManager.plasma6.enable = true; - environment.plasma6.excludePackages = with pkgs.libsForQt5; [ - plasma-browser-integration - konsole - oxygen - ]; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable gvfs - services.gvfs.enable = true; - - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - # Enable 32bit support for pulseaudio - hardware.pulseaudio.support32Bit = true; - - # Enable OpenGL - hardware.opengl = { - enable = true; - driSupport = true; - driSupport32Bit = true; - }; - - # Enable bluetooth - hardware.bluetooth.enable = true; - - # Open Tablet Driver setup - hardware.opentabletdriver.enable = true; - - # Load nvidia driver for Xorg and Wayland - services.xserver.videoDrivers = [ "amdgpu" ]; - - # Steam settings - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - gamescopeSession.enable = true; - }; - # List packages installed in system profile. environment.systemPackages = with pkgs; [ neovim @@ -152,6 +77,11 @@ ipafont ryzenadj wineWowPackages.staging + cryptsetup + xfsprogs + (catppuccin-kde.override { winDecStyles = [ "classic" "modern" ]; }) + catppuccin-cursors.frappeRosewater + (callPackage ./modules/catppuccin-sddm.nix { inherit pkgs; }) (lutris.override { extraPkgs = pkgs: [ @@ -163,33 +93,31 @@ hashlink ]; }) - cryptsetup - xfsprogs - (catppuccin-kde.override { winDecStyles = [ "classic" "modern" ]; }) - catppuccin-cursors.frappeRosewater - (callPackage ./modules/catppuccin-sddm.nix { inherit pkgs; }) ]; - # firewall settings - networking.firewall = { + # Steam settings + programs.steam = { enable = true; - # allow specific tcp ports - allowedTCPPorts = [ 2234 22000 ]; - # allow specific udp ports - allowedUDPPorts = [ 22000 21027 ]; - # if packets are still dropped, they will show up in dmesg - logReversePathDrops = true; - # wireguard trips rpfilter up - extraCommands = '' - ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN - ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN - ''; - extraStopCommands = '' - ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN || true - ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN || true - ''; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + gamescopeSession.enable = true; }; + # Setting up zsh + programs.zsh.enable = true; + + # For the completion plugin + environment.pathsToLink = [ "/share/zsh" ]; + + # Enable bluetooth + hardware.bluetooth.enable = true; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable gvfs + services.gvfs.enable = true; + # Enable fstrim services.fstrim.enable = true; @@ -209,11 +137,51 @@ }; }; - # Setting up zsh - programs.zsh.enable = true; + # Enable the X11 windowing system. + services.xserver.enable = true; - # For the completion plugin - environment.pathsToLink = [ "/share/zsh" ]; + # Enable touchpad support + services.xserver.libinput.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + options = "caps:escape"; + }; + + # Load nvidia driver for Xorg and Wayland + services.xserver.videoDrivers = [ "amdgpu" ]; + + # Enable OpenGL + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + + # Open Tablet Driver setup + hardware.opentabletdriver.enable = true; + + # firewall settings + networking.firewall = { + enable = true; + # allow specific tcp ports + allowedTCPPorts = [ 2234 22000 ]; + # allow specific udp ports + allowedUDPPorts = [ 22000 21027 ]; + # if packets are still dropped, they will show up in dmesg + logReversePathDrops = true; + # wireguard trips rpfilter up + extraCommands = '' + ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN + ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN + ''; + extraStopCommands = '' + ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN || true + ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN || true + ''; + }; # Defining my user users.users.crony = { diff --git a/nixos/modules/pipewire.nix b/nixos/modules/pipewire.nix new file mode 100644 index 0000000..a23ca11 --- /dev/null +++ b/nixos/modules/pipewire.nix @@ -0,0 +1,13 @@ +{ ... }: { + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + hardware.pulseaudio.support32Bit = true; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; +} diff --git a/nixos/modules/plasma.nix b/nixos/modules/plasma.nix new file mode 100644 index 0000000..00ed6a2 --- /dev/null +++ b/nixos/modules/plasma.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: { + # Setup plasma with excluding a couple unnecesarry packages + services.desktopManager.plasma6.enable = true; + environment.plasma6.excludePackages = with pkgs.libsForQt5; [ + plasma-browser-integration + konsole + oxygen + ]; +} diff --git a/nixos/modules/sddm.nix b/nixos/modules/sddm.nix new file mode 100644 index 0000000..3ea526a --- /dev/null +++ b/nixos/modules/sddm.nix @@ -0,0 +1,14 @@ +{ ... }: { + # Enable sddm with catppuccin theme and fix virtual keyboard bug + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + theme = "catppuccin-frappe"; + # Fix keyboard showing up unnecesarilly + settings = { + General = { InputMethod = ""; }; + # Setup nicer cursor theme + Theme = { CursorTheme = "Catppuccin-Frappe-Rosewater-Cursors"; }; + }; + }; +}