From aa54b7c40bc933421a10bf67ab5a17778b483d3a Mon Sep 17 00:00:00 2001 From: Melvin Ragusa Date: Mon, 2 Feb 2026 10:54:48 +0100 Subject: [PATCH] refactoring --- configuration.nix | 187 +++++++++++++++++++++++++------------------- flake.nix | 17 ++++ modules/apps.nix | 78 ++++++++++++++++++ modules/audio.nix | 43 ++++++++++ modules/desktop.nix | 119 ++++++++++++++++++++++++++++ modules/dev.nix | 111 ++++++++++++++++++++++++++ modules/gaming.nix | 85 ++++++++++++++++++++ modules/gpu-amd.nix | 64 +++++++++++++++ modules/theming.nix | 112 ++++++++++++++++++++++++++ 9 files changed, 736 insertions(+), 80 deletions(-) create mode 100644 modules/apps.nix create mode 100644 modules/audio.nix create mode 100644 modules/desktop.nix create mode 100644 modules/dev.nix create mode 100644 modules/gaming.nix create mode 100644 modules/gpu-amd.nix create mode 100644 modules/theming.nix diff --git a/configuration.nix b/configuration.nix index de431db..b48c288 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,35 +1,41 @@ -#configuration.nix -{ config, pkgs, inputs, ... }: +# configuration.nix +# Main NixOS configuration - imports modular components +{ config, pkgs, inputs, lib, ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; + imports = [ + # Hardware + ./hardware-configuration.nix - # Bootloader. + # Modular configuration + ./modules/desktop.nix # Portal, polkit, launcher, lock, wallpaper + ./modules/gpu-amd.nix # AMD graphics, Vulkan, VA-API + ./modules/audio.nix # Bluetooth, audio controls + ./modules/gaming.nix # Steam, Gamemode, Lutris, etc. + ./modules/apps.nix # User applications + ./modules/dev.nix # Docker, dev tools + ./modules/theming.nix # Fonts, themes, cursors + ]; + + # ═══════════════════════════════════════════════════════════════ + # BOOT + # ═══════════════════════════════════════════════════════════════ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - - # Use latest kernel. boot.kernelPackages = pkgs.linuxPackages_latest; - networking.hostName = "atlas"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking + # ═══════════════════════════════════════════════════════════════ + # NETWORKING + # ═══════════════════════════════════════════════════════════════ + networking.hostName = "atlas"; networking.networkmanager.enable = true; - # Set your time zone. + # ═══════════════════════════════════════════════════════════════ + # LOCALIZATION + # ═══════════════════════════════════════════════════════════════ time.timeZone = "Europe/Berlin"; - # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; - i18n.extraLocaleSettings = { LC_ADDRESS = "de_DE.UTF-8"; LC_IDENTIFICATION = "de_DE.UTF-8"; @@ -42,30 +48,23 @@ LC_TIME = "de_DE.UTF-8"; }; - # Enable the X11 windowing system (needed for some apps and Ly X11 support). - services.xserver.enable = true; + console.keyMap = "de-latin1-nodeadkeys"; - # Use Ly as the display manager. + # ═══════════════════════════════════════════════════════════════ + # DISPLAY & INPUT + # ═══════════════════════════════════════════════════════════════ + services.xserver.enable = true; services.displayManager.ly.enable = true; services.displayManager.defaultSession = "niri"; - # Configure keymap in X11 services.xserver.xkb = { layout = "de"; variant = "nodeadkeys"; }; - # Configure console keymap - console.keyMap = "de-latin1-nodeadkeys"; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable Bluetooth - hardware.bluetooth.enable = true; - hardware.bluetooth.powerOnBoot = true; - - # Enable sound with pipewire. + # ═══════════════════════════════════════════════════════════════ + # AUDIO (PipeWire) + # ═══════════════════════════════════════════════════════════════ services.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { @@ -73,84 +72,112 @@ alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; + jack.enable = true; # For pro audio apps }; - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; + # ═══════════════════════════════════════════════════════════════ + # BLUETOOTH + # ═══════════════════════════════════════════════════════════════ + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; - # Define a user account. Don't forget to set a password with ‘passwd’. + # ═══════════════════════════════════════════════════════════════ + # PRINTING + # ═══════════════════════════════════════════════════════════════ + services.printing.enable = true; + + # ═══════════════════════════════════════════════════════════════ + # USER + # ═══════════════════════════════════════════════════════════════ users.users.pinj = { isNormalUser = true; description = "Melvin Ragusa"; - extraGroups = [ "networkmanager" "wheel" ]; - packages = with pkgs; [ - # thunderbird + extraGroups = [ + "wheel" # Sudo access + "networkmanager" # Network configuration + # Additional groups are added by modules: + # - docker (dev.nix) + # - gamemode (gaming.nix) + # - corectrl (gpu-amd.nix) ]; + shell = pkgs.zsh; }; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - + # ═══════════════════════════════════════════════════════════════ + # PROGRAMS + # ═══════════════════════════════════════════════════════════════ + programs.zsh.enable = true; programs.yazi.enable = true; programs.firefox.enable = true; programs.niri.enable = true; - programs.zsh.enable = true; - users.users.pinj.shell = pkgs.zsh; - # Allow unfree packages + # ═══════════════════════════════════════════════════════════════ + # NIX SETTINGS + # ═══════════════════════════════════════════════════════════════ + nix.settings = { + experimental-features = [ "nix-command" "flakes" ]; + + # Optimize storage + auto-optimise-store = true; + + # Trust users for substituters + trusted-users = [ "root" "@wheel" ]; + }; + + # Garbage collection + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 14d"; + }; + nixpkgs.config.allowUnfree = true; - # List packages installed in system profile. To search, run: - # $ nix search wget + # ═══════════════════════════════════════════════════════════════ + # SYSTEM PACKAGES (Base essentials) + # ═══════════════════════════════════════════════════════════════ environment.systemPackages = with pkgs; [ + # Core utilities fastfetch - nil micro + wget + curl + + # Nix tools + nil # Nix LSP + + # Wayland xwayland-satellite grim slurp - wl-clipboard - git - gh + + # File management nautilus + + # Editors zed-editor + + # Flake inputs inputs.noctalia.packages.${pkgs.system}.default inputs.zen-browser.packages.${pkgs.system}.default inputs.ghostty.packages.${pkgs.system}.default inputs.opencode.packages.${pkgs.system}.default + + # AI coding claude-code + + # Package managers pnpm ]; - # Fonts - fonts.packages = with pkgs; [ - jetbrains-mono - nerd-fonts.jetbrains-mono - ]; - - fonts.fontconfig.enable = true; - - # List services that you want to enable: + # ═══════════════════════════════════════════════════════════════ + # SERVICES + # ═══════════════════════════════════════════════════════════════ services.openssh.enable = true; services.tailscale.enable = true; - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system 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 value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + # ═══════════════════════════════════════════════════════════════ + # SYSTEM + # ═══════════════════════════════════════════════════════════════ system.stateVersion = "25.11"; - } diff --git a/flake.nix b/flake.nix index 721607a..0d04d11 100644 --- a/flake.nix +++ b/flake.nix @@ -28,6 +28,23 @@ ghostty = { url = "github:ghostty-org/ghostty"; }; + + vicinae = { + url = "github:vicinaehq/vicinae"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + # Binary caches for faster builds + nixConfig = { + extra-substituters = [ + "https://vicinae.cachix.org" + "https://nix-community.cachix.org" + ]; + extra-trusted-public-keys = [ + "vicinae.cachix.org-1:1kDrfienkGHPYbkpNj1mWTr7Fm1+zcenzgTizIcI3oc=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; }; outputs = inputs@{ self, nixpkgs, ... }: diff --git a/modules/apps.nix b/modules/apps.nix new file mode 100644 index 0000000..816f299 --- /dev/null +++ b/modules/apps.nix @@ -0,0 +1,78 @@ +# modules/apps.nix +# User applications: media, productivity, communication, system utilities +{ config, pkgs, lib, ... }: + +{ + environment.systemPackages = with pkgs; [ + # ───────────────────────────────────────────────────────────── + # Media Viewers + # ───────────────────────────────────────────────────────────── + loupe # GNOME image viewer + evince # PDF/document viewer + celluloid # MPV frontend (GTK video player) + mpv # Powerful CLI video player + + # ───────────────────────────────────────────────────────────── + # Music + # ───────────────────────────────────────────────────────────── + amberol # Simple music player for local files + # Feishin available via Flatpak for Navidrome/Jellyfin + + # ───────────────────────────────────────────────────────────── + # Communication + # ───────────────────────────────────────────────────────────── + vesktop # Discord client (Wayland-native, with Vencord) + thunderbird # Email client + + # ───────────────────────────────────────────────────────────── + # Office & Productivity + # ───────────────────────────────────────────────────────────── + libreoffice-fresh # Office suite (latest) + obsidian # Note-taking with Markdown + + # ───────────────────────────────────────────────────────────── + # System Utilities + # ───────────────────────────────────────────────────────────── + btop # Modern system monitor (terminal) + mission-center # GNOME system monitor (GUI, like Windows Task Manager) + + # File management + file-roller # Archive manager (GUI) + gnome-disk-utility # Disk management + + # Archive tools (for file-roller and CLI) + unzip + zip + p7zip + unrar + + # ───────────────────────────────────────────────────────────── + # Screenshots + # ───────────────────────────────────────────────────────────── + swappy # Screenshot annotation tool + # grim + slurp already in your base config + + # ───────────────────────────────────────────────────────────── + # Security & Passwords + # ───────────────────────────────────────────────────────────── + bitwarden-desktop # Password manager + seahorse # GNOME Keyring GUI + + # ───────────────────────────────────────────────────────────── + # Utilities + # ───────────────────────────────────────────────────────────── + gnome-calculator # Calculator + gnome-clocks # World clocks, alarms, timers + baobab # Disk usage analyzer + ]; + + # GNOME Keyring for secrets storage + services.gnome.gnome-keyring.enable = true; + + # Enable Flatpak for additional apps (Feishin, etc.) + services.flatpak.enable = true; + + # Add Flathub repository automatically on activation + # Run manually after first boot: flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo + # Then install Feishin: flatpak install flathub io.github.feishin.feishin +} diff --git a/modules/audio.nix b/modules/audio.nix new file mode 100644 index 0000000..5402650 --- /dev/null +++ b/modules/audio.nix @@ -0,0 +1,43 @@ +# modules/audio.nix +# Audio and Bluetooth configuration: Blueman GUI, volume control, media keys +{ config, pkgs, lib, ... }: + +{ + # Bluetooth GUI management + services.blueman.enable = true; + + # Audio packages + environment.systemPackages = with pkgs; [ + # PipeWire volume control + pwvucontrol # Modern PipeWire volume control (Qt) + pavucontrol # Classic PulseAudio volume control (GTK) - as backup + helvum # PipeWire patchbay for routing audio + + # Media player control + playerctl # Control media players via D-Bus (for media keys) + + # Audio tools + easyeffects # Audio effects and equalizer for PipeWire + + # Bluetooth audio codecs are handled by PipeWire automatically + ]; + + # Ensure PipeWire has good Bluetooth codec support + # This is already configured in your main config, but we ensure AAC/LDAC support + services.pipewire.wireplumber.extraConfig = { + "10-bluez" = { + "monitor.bluez.properties" = { + # Enable all Bluetooth codecs + "bluez5.enable-sbc-xq" = true; + "bluez5.enable-msbc" = true; + "bluez5.enable-hw-volume" = true; + + # Bluetooth headset roles + "bluez5.roles" = [ "a2dp_sink" "a2dp_source" "bap_sink" "bap_source" "hsp_hs" "hsp_ag" "hfp_hf" "hfp_ag" ]; + + # Codec preference order (highest quality first) + "bluez5.codecs" = [ "ldac" "aac" "aptx_hd" "aptx" "sbc_xq" "sbc" ]; + }; + }; + }; +} diff --git a/modules/desktop.nix b/modules/desktop.nix new file mode 100644 index 0000000..85957c2 --- /dev/null +++ b/modules/desktop.nix @@ -0,0 +1,119 @@ +# modules/desktop.nix +# Core desktop infrastructure: portals, polkit, launcher, screen lock, wallpaper, idle +{ config, pkgs, inputs, lib, ... }: + +{ + # XDG Portal - Required for screen sharing, file pickers, etc. + xdg.portal = { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + config.common.default = "*"; + }; + + # Polkit - GUI privilege escalation + security.polkit.enable = true; + + # Polkit authentication agent (runs on login) + systemd.user.services.polkit-gnome-agent = { + description = "Polkit GNOME Authentication Agent"; + wantedBy = [ "graphical-session.target" ]; + wants = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + + # Screen locker service (swayidle triggers this) + systemd.user.services.swaylock = { + description = "Screen Locker"; + serviceConfig = { + Type = "forking"; + ExecStart = "${pkgs.swaylock-effects}/bin/swaylock -f"; + }; + }; + + # Idle daemon - lock screen and turn off display + systemd.user.services.swayidle = { + description = "Idle Manager"; + wantedBy = [ "graphical-session.target" ]; + wants = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = '' + ${pkgs.swayidle}/bin/swayidle -w \ + timeout 300 'systemctl --user start swaylock' \ + timeout 600 'niri msg action power-off-monitors' \ + before-sleep 'systemctl --user start swaylock' + ''; + Restart = "on-failure"; + RestartSec = 1; + }; + }; + + # Wallpaper service + systemd.user.services.swaybg = { + description = "Wallpaper Daemon"; + wantedBy = [ "graphical-session.target" ]; + wants = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + Type = "simple"; + # Default to a solid color - change path to your wallpaper + ExecStart = "${pkgs.swaybg}/bin/swaybg -c '#1e1e2e'"; + Restart = "on-failure"; + }; + }; + + # Desktop packages + environment.systemPackages = with pkgs; [ + # Vicinae launcher + inputs.vicinae.packages.${pkgs.system}.default + + # Screen lock & idle + swaylock-effects + swayidle + + # Wallpaper + swaybg + + # Polkit agent + polkit_gnome + + # Portal helpers + xdg-utils + xdg-user-dirs + + # Wayland utilities + wl-clipboard + wtype # Wayland keyboard automation + wlr-randr # Display configuration + wayland-utils # Debug utilities + ]; + + # Environment variables for Wayland compatibility + environment.sessionVariables = { + # Wayland defaults + NIXOS_OZONE_WL = "1"; # Electron apps use Wayland + MOZ_ENABLE_WAYLAND = "1"; # Firefox Wayland + QT_QPA_PLATFORM = "wayland"; # Qt apps use Wayland + SDL_VIDEODRIVER = "wayland"; # SDL games use Wayland + _JAVA_AWT_WM_NONREPARENTING = "1"; # Java apps fix + + # XDG + XDG_SESSION_TYPE = "wayland"; + XDG_CURRENT_DESKTOP = "niri"; + }; + + # Enable dconf for GTK settings + programs.dconf.enable = true; + + # GNOME services for better desktop integration + services.gvfs.enable = true; # Virtual filesystem (trash, MTP, SMB) + services.udisks2.enable = true; # Disk mounting +} diff --git a/modules/dev.nix b/modules/dev.nix new file mode 100644 index 0000000..3fa4c56 --- /dev/null +++ b/modules/dev.nix @@ -0,0 +1,111 @@ +# modules/dev.nix +# Development tools: Docker, Node.js, direnv, build tools +{ config, pkgs, lib, ... }: + +{ + # Docker + virtualisation.docker = { + enable = true; + + # Recommended settings + autoPrune = { + enable = true; + dates = "weekly"; + flags = [ "--all" ]; + }; + }; + + # Add user to docker group + users.users.pinj.extraGroups = [ "docker" ]; + + # Direnv for per-project environments + programs.direnv = { + enable = true; + nix-direnv.enable = true; # Faster direnv for Nix + }; + + # Development packages + environment.systemPackages = with pkgs; [ + # ───────────────────────────────────────────────────────────── + # Containers + # ───────────────────────────────────────────────────────────── + docker-compose # Docker Compose v2 + lazydocker # Terminal UI for Docker + + # ───────────────────────────────────────────────────────────── + # Languages & Runtimes + # ───────────────────────────────────────────────────────────── + nodejs_22 # Node.js LTS (for Vicinae extensions, etc.) + bun # Fast JavaScript runtime/bundler + python3 # Python 3 + rustup # Rust toolchain manager + + # ───────────────────────────────────────────────────────────── + # Build Tools + # ───────────────────────────────────────────────────────────── + gcc + gnumake + cmake + pkg-config + + # ───────────────────────────────────────────────────────────── + # Version Control + # ───────────────────────────────────────────────────────────── + git + gh # GitHub CLI + lazygit # Terminal UI for Git + delta # Better git diff + + # ───────────────────────────────────────────────────────────── + # Editors & LSP + # ───────────────────────────────────────────────────────────── + # nil already in base config (Nix LSP) + nixfmt-rfc-style # Nix formatter + + # ───────────────────────────────────────────────────────────── + # CLI Utilities + # ───────────────────────────────────────────────────────────── + jq # JSON processor + yq # YAML processor + ripgrep # Fast grep + fd # Fast find + fzf # Fuzzy finder + eza # Modern ls + bat # Cat with syntax highlighting + httpie # Better curl + curlie # Curl wrapper with httpie-like syntax + + # ───────────────────────────────────────────────────────────── + # Database Tools + # ───────────────────────────────────────────────────────────── + dbeaver-bin # Universal database tool (GUI) + ]; + + # Better shell experience for development + programs.zsh = { + # Already enabled in base config + autosuggestions.enable = true; + syntaxHighlighting.enable = true; + + shellAliases = { + ll = "eza -la --icons --git"; + ls = "eza --icons"; + cat = "bat"; + find = "fd"; + grep = "rg"; + + # Docker shortcuts + dc = "docker-compose"; + dps = "docker ps"; + + # Git shortcuts + gs = "git status"; + gd = "git diff"; + gl = "git log --oneline -20"; + + # NixOS shortcuts + rebuild = "sudo nixos-rebuild switch --flake ."; + update = "nix flake update"; + }; + }; +} diff --git a/modules/gaming.nix b/modules/gaming.nix new file mode 100644 index 0000000..f048fb9 --- /dev/null +++ b/modules/gaming.nix @@ -0,0 +1,85 @@ +# modules/gaming.nix +# Full gaming setup: Steam, Gamemode, Lutris, Heroic, MangoHud, Wine, Proton +{ config, pkgs, lib, ... }: + +{ + # Steam + programs.steam = { + enable = true; + remotePlay.openFirewall = true; # Steam Remote Play + dedicatedServer.openFirewall = true; # Dedicated servers + localNetworkGameTransfers.openFirewall = true; # LAN game transfers + + # Extra compatibility packages for Proton + extraCompatPackages = with pkgs; [ + proton-ge-bin # GloriousEggroll's Proton fork - better compatibility + ]; + }; + + # Gamemode - Optimize system for gaming + programs.gamemode = { + enable = true; + enableRenice = true; # Allow renice for priority boost + settings = { + general = { + renice = 10; + softrealtime = "auto"; + inhibit_screensaver = 1; + }; + gpu = { + apply_gpu_optimisations = "accept-responsibility"; + gpu_device = 0; + amd_performance_level = "high"; + }; + }; + }; + + # Steam hardware support (controllers, VR, etc.) + hardware.steam-hardware.enable = true; + + # Gaming packages + environment.systemPackages = with pkgs; [ + # Game launchers + lutris # Multi-platform game launcher + heroic # Epic Games & GOG launcher + + # Proton management + protonup-qt # GUI to manage Proton-GE versions + + # Performance overlay + mangohud # FPS counter, GPU/CPU stats overlay + goverlay # GUI to configure MangoHud + + # Wine for non-Steam games + wineWowPackages.stagingFull # Latest Wine with all features + winetricks # Wine helper scripts + protontricks # Proton helper scripts (like winetricks for Proton) + + # Misc gaming utilities + gamemode # CLI tool to trigger gamemode + gamescope # Micro-compositor for games (fixes some issues) + ]; + + # Allow MangoHud to work properly + environment.variables = { + MANGOHUD = "1"; # Enable by default (can be toggled per-game) + }; + + # Gaming-related kernel tweaks + boot.kernel.sysctl = { + # Increase file watchers for large games + "fs.inotify.max_user_watches" = 524288; + + # Better memory management for gaming + "vm.swappiness" = 10; + "vm.vfs_cache_pressure" = 50; + }; + + # Udev rules for game controllers + services.udev.packages = with pkgs; [ + game-devices-udev-rules # Support for various game controllers + ]; + + # Add user to gamemode group + users.users.pinj.extraGroups = [ "gamemode" ]; +} diff --git a/modules/gpu-amd.nix b/modules/gpu-amd.nix new file mode 100644 index 0000000..8643256 --- /dev/null +++ b/modules/gpu-amd.nix @@ -0,0 +1,64 @@ +# modules/gpu-amd.nix +# AMD GPU configuration: drivers, Vulkan, VA-API hardware acceleration, CoreCtrl +{ config, pkgs, lib, ... }: + +{ + # Enable OpenGL/Vulkan + hardware.graphics = { + enable = true; + enable32Bit = true; # For Steam and 32-bit games + + extraPackages = with pkgs; [ + # VA-API for hardware video acceleration + vaapiVdpau + libvdpau-va-gl + + # AMD-specific + amdvlk # AMD's official Vulkan driver (alternative to RADV) + rocmPackages.clr.icd # OpenCL support + ]; + + extraPackages32 = with pkgs.driversi686Linux; [ + # 32-bit VA-API support for older games + vaapiVdpau + libvdpau-va-gl + amdvlk + ]; + }; + + # Use RADV (Mesa) as default Vulkan driver - generally better for gaming + # AMDVLK is available as fallback via VK_ICD_FILENAMES + environment.variables = { + AMD_VULKAN_ICD = "RADV"; # Use RADV by default + }; + + # CoreCtrl for fan curves, overclocking, and GPU monitoring + programs.corectrl = { + enable = true; + gpuOverclock.enable = true; # Enable overclocking capabilities + }; + + # Add user to corectrl group for full access without password + users.users.pinj.extraGroups = [ "corectrl" ]; + + # Kernel parameters for AMD GPU + boot.kernelParams = [ + # Enable all power management features + "amdgpu.ppfeaturemask=0xffffffff" + ]; + + # GPU monitoring tools + environment.systemPackages = with pkgs; [ + # Monitoring + radeontop # AMD GPU monitoring (like nvidia-smi) + nvtopPackages.amd # Modern GPU monitor with AMD support + + # Vulkan tools + vulkan-tools # vulkaninfo, etc. + vulkan-loader + + # Video acceleration verification + libva-utils # vainfo - verify VA-API + vdpauinfo # Verify VDPAU + ]; +} diff --git a/modules/theming.nix b/modules/theming.nix new file mode 100644 index 0000000..6ad3241 --- /dev/null +++ b/modules/theming.nix @@ -0,0 +1,112 @@ +# modules/theming.nix +# Visual theming: fonts, GTK/Qt themes, cursors, icons +{ config, pkgs, lib, ... }: + +{ + # ───────────────────────────────────────────────────────────── + # Fonts + # ───────────────────────────────────────────────────────────── + fonts = { + packages = with pkgs; [ + # Your existing fonts + jetbrains-mono + nerd-fonts.jetbrains-mono + + # Additional fonts for full coverage + inter # Modern UI font + noto-fonts # Wide Unicode coverage + noto-fonts-cjk-sans # Chinese, Japanese, Korean + noto-fonts-emoji # Color emoji + + # Optional nice fonts + source-sans # Adobe Source Sans + source-serif # Adobe Source Serif + source-code-pro # Adobe Source Code + fira-code # Alternative coding font with ligatures + ]; + + fontconfig = { + enable = true; + + # Default fonts + defaultFonts = { + sansSerif = [ "Inter" "Noto Sans" ]; + serif = [ "Noto Serif" ]; + monospace = [ "JetBrainsMono Nerd Font" "JetBrains Mono" ]; + emoji = [ "Noto Color Emoji" ]; + }; + + # Font rendering settings + hinting = { + enable = true; + style = "slight"; + }; + antialias = true; + subpixel.rgba = "rgb"; + }; + }; + + # ───────────────────────────────────────────────────────────── + # GTK Theme + # ───────────────────────────────────────────────────────────── + environment.systemPackages = with pkgs; [ + # GTK themes + adw-gtk3 # GTK3 theme matching libadwaita + adwaita-icon-theme # GNOME icons (needed for many apps) + + # Icon theme + papirus-icon-theme # Modern, flat icons + + # Cursor theme + bibata-cursors # Modern cursor theme + + # Qt theming + qt5ct # Qt5 configuration tool + qt6ct # Qt6 configuration tool + adwaita-qt # Adwaita theme for Qt5 + adwaita-qt6 # Adwaita theme for Qt6 + + # Theme tools + dconf-editor # Edit GNOME/GTK settings + nwg-look # GTK settings editor for Wayland + ]; + + # ───────────────────────────────────────────────────────────── + # Qt Theming Environment + # ───────────────────────────────────────────────────────────── + environment.sessionVariables = { + # Qt platform integration + QT_QPA_PLATFORMTHEME = "qt5ct"; + + # Cursor theme (for apps that don't respect system settings) + XCURSOR_THEME = "Bibata-Modern-Classic"; + XCURSOR_SIZE = "24"; + }; + + # ───────────────────────────────────────────────────────────── + # GTK Settings via dconf + # ───────────────────────────────────────────────────────────── + # These can be overridden by the user with nwg-look or dconf-editor + # Default theme settings are applied per-user + + programs.dconf = { + enable = true; + profiles.user.databases = [{ + settings = { + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + gtk-theme = "adw-gtk3-dark"; + icon-theme = "Papirus-Dark"; + cursor-theme = "Bibata-Modern-Classic"; + cursor-size = lib.gvariant.mkInt32 24; + font-name = "Inter 11"; + document-font-name = "Inter 11"; + monospace-font-name = "JetBrainsMono Nerd Font 10"; + }; + "org/gnome/desktop/wm/preferences" = { + titlebar-font = "Inter Bold 11"; + }; + }; + }]; + }; +}