chore: fix unnecessary and not available pkgs, cleaning

This commit is contained in:
Rasyidan Akbar F. 2025-10-24 16:52:06 +07:00
commit 2585a86dc9
25 changed files with 703 additions and 462 deletions

View file

@ -1,34 +1,176 @@
# Desktop Environments
This directory contains system-level desktop environment configurations.
This directory contains system-level desktop environment configurations for NixOS desktop hosts.
## Structure
```
desktops/
├── base.nix # Shared desktop settings (XDG portals, polkit, gvfs)
├── plasma.nix # KDE Plasma 6 + SDDM
├── hyprland/ # Hyprland tiling compositor
│ └── default.nix
├── gaming.nix # Steam, Proton, GameMode, gaming tools
├── apps/ # Desktop applications
│ ├── browsers.nix # Brave, Zen Browser
│ └── terminals.nix # Alacritty (Dracula theme)
├── themes/ # Theme configurations
│ ├── catppuccin.nix # Catppuccin GTK/Qt theme
│ └── default.nix # Adwaita default theme
└── hardware-configuration.nix # Hardware-specific settings (generated)
```
## Available Desktop Environments
- `hyprland.nix` - Dynamic tiling Wayland compositor
- `plasma.nix` - KDE Plasma 6 desktop environment
- `niri.nix` - Scrollable-tiling Wayland compositor
- `base.nix` - Shared desktop settings (imported by all DEs)
### KDE Plasma 6 (`plasma.nix`)
- Full-featured desktop with SDDM display manager
- Wayland-first with X11 fallback
- Includes essential KDE applications (commented out by default)
- User-level Plasma configuration via Home Manager (optional)
### Hyprland (`hyprland/default.nix`)
- Dynamic tiling Wayland compositor
- Minimal default keybinds (SUPER key)
- Includes Wayland utilities: wl-clipboard, grim, slurp
- User-level configuration for keybinds, visual settings
## Additional Modules
### Gaming (`gaming.nix`)
**Features:**
- Steam with Proton GE compatibility
- GameMode for performance optimization
- 32-bit graphics support for games
- Wine, Winetricks, Lutris, Heroic launcher
- MangoHud for FPS overlay
- Discord for communication
- Increased inotify watchers for modding tools
### Apps (`apps/`)
**Browsers** (`browsers.nix`):
- Brave, Zen Browser (enabled by default)
**Terminals** (`terminals.nix`):
- Alacritty enabled with JetBrains Mono + Dracula theme
- Kitty and WezTerm explicitly disabled to keep a single default
### Themes (`themes/`)
**Catppuccin** (`catppuccin.nix`):
- Soothing pastel theme for GTK and Qt
- Mocha variant with blue accents
- Kvantum Qt theme engine
- Papirus icon theme
- Catppuccin cursor theme
**Default** (`default.nix`):
- Adwaita theme (GNOME default)
- Minimal theming setup
## Usage
### Single Desktop Environment
Import one desktop environment in your host configuration:
```nix
# modules/nixos/hosts/your-host.nix
{
imports = [
../desktops/hyprland.nix
../desktops/plasma.nix
# OR
# ../desktops/plasma.nix
# OR
# ../desktops/niri.nix
# ../desktops/hyprland
];
}
```
### Multi-Desktop Setup (Switch at Login)
The current desktop host uses both KDE Plasma (for gaming) and Hyprland (for development):
```nix
# modules/nixos/hosts/desktop.nix
{
imports = [
# Hardware
../desktops/hardware-configuration.nix
# Desktop Environments
../desktops/plasma.nix # KDE Plasma (for gaming)
../desktops/hyprland # Hyprland (for development)
# Desktop Apps & Theme
../desktops/apps/browsers.nix
../desktops/apps/terminals.nix
../desktops/themes/catppuccin.nix
# Gaming & Features
../desktops/gaming.nix
../bluetooth.nix
];
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
kernelPackages = pkgs.linuxPackages_cachyos-lts;
};
networking.hostName = "desktop";
system.stateVersion = "24.05";
}
```
**Boot Configuration:**
- CachyOS LTS kernel for gaming performance
- Systemd-boot for EFI boot management
**Switch Desktop at Login:**
- SDDM login screen shows both Plasma and Hyprland sessions
- Select desired environment before logging in
## Base Desktop Settings (`base.nix`)
Shared settings imported by all desktop environments:
- **XDG Portals**: Desktop integration, file picker, screen sharing
- **PolicyKit**: Privilege escalation for GUI apps
- **GVFS**: Trash, mounting, network drives
- **Common Packages**: pavucontrol, networkmanagerapplet
## Adding a New Desktop Environment
1. Create a new file (e.g., `gnome.nix`)
2. Import `./base.nix`
3. Enable the desktop environment
2. Import `./base.nix` for shared settings
3. Enable the desktop environment and display manager
4. Add essential system packages
5. Configure user-level settings via Home Manager
Example:
```nix
{ lib, pkgs, user, ... }: {
imports = [ ./base.nix ];
services.xserver = {
enable = true;
desktopManager.gnome.enable = true;
displayManager.gdm.enable = true;
};
environment.systemPackages = with pkgs; [
gnome-tweaks
];
}
```
## Testing Desktop Changes
```bash
# Dry-run to check closure
nix build .#nixosConfigurations.desktop.config.system.build.toplevel --dry-run
# Build and switch
sudo nixos-rebuild switch --flake .#desktop
# Format before committing
nix fmt
```

View file

@ -0,0 +1,9 @@
{ pkgs, user, ... }:
{
# Browser configurations for desktop users
home-manager.users.${user} = {
# User packages: Browsers
home.packages = with pkgs; [ brave ];
};
}

View file

@ -0,0 +1,114 @@
{ lib, pkgs, user, ... }: {
# Terminal emulator configurations for desktop users
home-manager.users.${user} = {
# Provide JetBrains Mono font locally for Alacritty.
home.packages = with pkgs; [ jetbrains-mono ];
# Ensure Kitty stays disabled when desktop module is imported.
programs.kitty.enable = lib.mkForce false;
# Configure Alacritty as the default terminal with Dracula theme.
programs.alacritty = {
enable = true;
settings = {
window.opacity = 0.85;
font = {
normal = {
family = "JetBrains Mono";
style = "Regular";
};
bold = {
family = "JetBrains Mono";
style = "Bold";
};
italic = {
family = "JetBrains Mono";
style = "Italic";
};
bold_italic = {
family = "JetBrains Mono";
style = "Bold Italic";
};
size = 12.0;
};
colors = {
primary = {
background = "#282a36";
foreground = "#f8f8f2";
bright_foreground = "#ffffff";
};
cursor = {
text = "#282a36";
cursor = "#f8f8f2";
};
vi_mode_cursor = {
text = "CellBackground";
cursor = "CellForeground";
};
selection = {
text = "CellForeground";
background = "#44475a";
};
normal = {
black = "#21222c";
red = "#ff5555";
green = "#50fa7b";
yellow = "#f1fa8c";
blue = "#bd93f9";
magenta = "#ff79c6";
cyan = "#8be9fd";
white = "#f8f8f2";
};
bright = {
black = "#6272a4";
red = "#ff6e6e";
green = "#69ff94";
yellow = "#ffffa5";
blue = "#d6acff";
magenta = "#ff92df";
cyan = "#a4ffff";
white = "#ffffff";
};
search = {
matches = {
foreground = "#44475a";
background = "#50fa7b";
};
focused_match = {
foreground = "#44475a";
background = "#ffb86c";
};
};
footer_bar = {
background = "#282a36";
foreground = "#f8f8f2";
};
hints = {
start = {
foreground = "#282a36";
background = "#f1fa8c";
};
end = {
foreground = "#f1fa8c";
background = "#282a36";
};
};
};
};
};
# Keep WezTerm disabled to avoid conflicting terminal defaults.
programs.wezterm.enable = lib.mkForce false;
};
}

View file

@ -0,0 +1,76 @@
{ pkgs, ... }: {
# Gaming configuration module
# Steam, Proton, Vulkan, Wine, and gaming optimizations
# Steam with Proton support
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
# Enable Proton compatibility layer
extraCompatPackages = with pkgs;
[
proton-ge-bin # GloriousEggroll's Proton builds
];
};
# GameMode for performance optimization
programs.gamemode = {
enable = true;
settings = {
general = { renice = 10; };
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
};
};
};
# Enable 32-bit graphics support for games
hardware.graphics = {
enable = true;
enable32Bit = true;
};
# Gaming-related packages
environment.systemPackages = with pkgs; [
# Game launchers
lutris
heroic # Epic Games, GOG launcher
# bottles # Windows app manager
# Wine for Windows games
wineWowPackages.stable # Both 32 and 64-bit Wine
winetricks
# Performance monitoring
mangohud # FPS overlay and performance metrics
# gamescope # Gaming compositor/micro-compositor
# Proton utilities
# protonup-qt # Manage Proton versions
protontricks # Winetricks for Proton games
# Communication
discord
# teamspeak_client
# Other gaming tools
# steam-run # Run non-Steam games in Steam runtime
];
# Vulkan support
environment.variables = {
# Enable Vulkan validation layers for debugging (optional)
# VK_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
};
# Kernel parameters for gaming performance (optional, adjust as needed)
# boot.kernelParams = [
# "mitigations=off" # Disable CPU mitigations for performance (less secure)
# ];
# Increase file watchers for game modding tools
boot.kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; };
}

View file

@ -0,0 +1,78 @@
# Hardware configuration for desktop
# Generated by running: nixos-generate-config --show-hardware-config
# This file contains hardware-specific settings that should be adjusted for your actual hardware
{ config, lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
# Kernel modules needed during boot
# Adjust based on your hardware (NVMe, SATA, USB, etc.)
boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; # Change to "kvm-intel" for Intel CPUs
# Filesystem configuration
# Run `lsblk -f` or `blkid` to get your actual device UUIDs
fileSystems."/" = {
device = "/dev/disk/by-uuid/REPLACE-WITH-YOUR-ROOT-UUID";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/REPLACE-WITH-YOUR-BOOT-UUID";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
# Swap configuration (optional)
# Uncomment and adjust if you have a swap partition
# swapDevices = [
# { device = "/dev/disk/by-uuid/REPLACE-WITH-YOUR-SWAP-UUID"; }
# ];
# CPU microcode updates
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
# For Intel CPUs, use this instead:
# hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# GPU configuration
# Uncomment the section that matches your GPU
# NVIDIA GPU
# services.xserver.videoDrivers = [ "nvidia" ];
# hardware.nvidia = {
# modesetting.enable = true;
# powerManagement.enable = false;
# powerManagement.finegrained = false;
# open = false; # Use proprietary driver
# nvidiaSettings = true;
# package = config.boot.kernelPackages.nvidiaPackages.stable;
# };
# AMD GPU
# services.xserver.videoDrivers = [ "amdgpu" ];
# hardware.opengl = {
# enable = true;
# driSupport = true;
# driSupport32Bit = true; # For 32-bit games
# };
# Intel GPU
# services.xserver.videoDrivers = [ "modesetting" ];
# hardware.opengl = {
# enable = true;
# extraPackages = with pkgs; [
# intel-media-driver
# vaapiIntel
# vaapiVdpau
# libvdpau-va-gl
# ];
# };
# Maximum number of open files
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -1,30 +0,0 @@
{ pkgs, lib, ... }: {
imports = [ ./base.nix ];
# Hyprland - Dynamic tiling Wayland compositor
programs.hyprland = {
enable = lib.mkDefault true;
xwayland.enable = lib.mkDefault true;
};
# Wayland-specific portal
xdg.portal.wlr.enable = lib.mkDefault true;
# Essential Wayland tools (system-level)
environment.systemPackages = with pkgs; [
# Wayland essentials
wayland
wl-clipboard
wlr-randr
# Screenshot & screen recording
grim # Screenshot
slurp # Region selector
# wf-recorder # Screen recording (optional)
# Add your preferred apps here
# kitty # Terminal
# wofi # Launcher
# waybar # Bar
];
}

View file

@ -0,0 +1,71 @@
{ pkgs, lib, user, ... }: {
imports = [ ../base.nix ];
# System-level: Enable Hyprland
programs.hyprland = {
enable = lib.mkDefault true;
xwayland.enable = lib.mkDefault true;
};
# Wayland-specific portal
xdg.portal.wlr.enable = lib.mkDefault true;
# System packages: Wayland essentials
environment.systemPackages = with pkgs; [
# Wayland essentials
wayland
wl-clipboard
wlr-randr
# Screenshot & screen recording
grim # Screenshot
slurp # Region selector
# wf-recorder # Screen recording (optional)
];
# User-level: Hyprland configuration
home-manager.users.${user} = {
wayland.windowManager.hyprland = {
enable = lib.mkDefault true;
xwayland.enable = lib.mkDefault true;
settings = {
# Minimal config - expand as needed
"$mod" = "SUPER";
# Example keybinds
bind = [
"$mod, Return, exec, kitty" # Terminal
"$mod, Q, killactive"
"$mod, M, exit"
"$mod, F, fullscreen"
"$mod, Space, togglefloating"
# Move focus
"$mod, h, movefocus, l"
"$mod, l, movefocus, r"
"$mod, k, movefocus, u"
"$mod, j, movefocus, d"
];
# Visual settings
general = {
gaps_in = 5;
gaps_out = 10;
border_size = 2;
};
decoration = { rounding = 8; };
};
};
# User packages: Hyprland utilities
home.packages = with pkgs;
[
# Uncomment as needed:
# wofi # Launcher
# waybar # Status bar
# dunst # Notifications
];
};
}

View file

@ -1,25 +0,0 @@
{ pkgs, lib, ... }: {
imports = [ ./base.nix ];
# Niri - Scrollable-tiling Wayland compositor
programs.niri = { enable = lib.mkDefault true; };
# Wayland-specific portal
xdg.portal.wlr.enable = lib.mkDefault true;
# Essential Wayland tools
environment.systemPackages = with pkgs; [
# Wayland essentials
wayland
wl-clipboard
# Screenshot tools
grim
slurp
# Add your preferred apps here
# kitty # Terminal
# fuzzel # Launcher (recommended for niri)
# waybar # Bar
];
}

View file

@ -1,7 +1,7 @@
{ lib, ... }: {
{ lib, pkgs, user, ... }: {
imports = [ ./base.nix ];
# KDE Plasma 6
# System-level: KDE Plasma 6
services.desktopManager.plasma6.enable = lib.mkDefault true;
# SDDM display manager
@ -10,6 +10,33 @@
wayland.enable = lib.mkDefault true;
};
# KDE apps are managed by Plasma
# Add extra packages in your host config if needed
# System packages: KDE applications
environment.systemPackages = with pkgs;
[
# KDE applications (uncomment as needed)
# kdePackages.kate # Text editor
# kdePackages.dolphin # File manager
# kdePackages.konsole # Terminal
# kdePackages.okular # Document viewer
# kdePackages.gwenview # Image viewer
# kdePackages.spectacle # Screenshot tool
];
# User-level: KDE Plasma settings (optional)
home-manager.users.${user} = {
# KDE Plasma configuration via Home Manager (optional)
# programs.plasma = {
# enable = true;
# workspace = {
# theme = "breeze-dark";
# colorScheme = "BreezeDark";
# };
# };
# User packages for KDE environment
home.packages = with pkgs;
[
# Add user-specific apps here
];
};
}

View file

@ -0,0 +1,64 @@
{ lib, pkgs, user, ... }: {
# Catppuccin theme configuration
# Soothing pastel theme for both GTK and Qt applications
# Works with KDE Plasma, Hyprland, and other desktop environments
# System packages: Theme engines and Catppuccin themes
environment.systemPackages = with pkgs; [
libsForQt5.qtstyleplugin-kvantum # Kvantum Qt theme engine
qt6Packages.qtstyleplugin-kvantum # Kvantum for Qt6
catppuccin-kvantum # Catppuccin theme for Kvantum
catppuccin-cursors # Catppuccin cursor theme
];
home-manager.users.${user} = {
# GTK theming - Catppuccin Mocha variant
gtk = {
enable = true;
theme = {
name = "Catppuccin-Mocha-Standard-Blue-Dark";
package = pkgs.catppuccin-gtk.override {
accents = [
"blue"
]; # Options: blue, flamingo, green, lavender, maroon, mauve, peach, pink, red, rosewater, sapphire, sky, teal, yellow
size = "standard"; # Options: standard, compact
variant = "mocha"; # Options: latte, frappe, macchiato, mocha
};
};
# GTK icon theme
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
};
# Qt theming - Catppuccin via Kvantum
qt = {
enable = true;
platformTheme.name = "kvantum";
style.name = "kvantum";
};
# Kvantum configuration
xdg.configFile."Kvantum/kvantum.kvconfig".text = ''
[General]
theme=Catppuccin-Mocha-Blue
'';
# Cursor theme
home.pointerCursor = {
name = "catppuccin-mocha-blue-cursors";
package = pkgs.catppuccin-cursors.mochaBlue;
size = 24;
gtk.enable = true;
x11.enable = true;
};
# XDG user directories for desktop environments
xdg.userDirs = {
enable = true;
createDirectories = true;
};
};
}

View file

@ -0,0 +1,33 @@
{ lib, pkgs, user, ... }: {
# Default theme configuration for desktop
# Simple Adwaita-dark theme that works across all desktop environments
# Switch to catppuccin.nix or create your own for custom themes
home-manager.users.${user} = {
# GTK theming - Adwaita Dark
gtk = {
enable = lib.mkDefault true;
theme = lib.mkDefault {
name = "Adwaita-dark";
package = pkgs.gnome-themes-extra;
};
iconTheme = lib.mkDefault {
name = "Adwaita";
package = pkgs.adwaita-icon-theme;
};
};
# Qt theming - Use GTK theme for consistency
qt = {
enable = lib.mkDefault true;
platformTheme.name = lib.mkDefault "gtk";
style.name = lib.mkDefault "adwaita-dark";
};
# XDG user directories for desktop environments
xdg.userDirs = {
enable = true;
createDirectories = true;
};
};
}