Add new server modules and configurations for various services
/ update-readme (push) Has been cancelled
/ update-readme (push) Has been cancelled
- Introduced `default-creds` module for managing default credentials with Umami integration. - Added `fail2ban` module for brute-force attack protection with configurable ban times. - Created `firewall` module to enable and configure basic firewall settings. - Implemented `gitea` module for self-hosted Git service with PostgreSQL backend. - Developed `glance` module for a customizable dashboard with various widgets and themes. - Added `iknowyou` module for a self-hosted password manager with production and demo environments. - Introduced `kernel-hardening` module for enhancing kernel security settings. - Created `mazanoke` module for a simple web application with Nginx integration. - Added `mealie` module for a self-hosted meal planning application. - Implemented `stirling-pdf` module for PDF generation service. - Developed `umami` module for self-hosted analytics with secret management. - Added `ssh` module for secure SSH configuration with user restrictions. - Introduced `nixy` theme for a customized aesthetic experience across services.
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
# Nvidia configuration for NixOS with Wayland and Hyprland support
|
||||
# Import this module only if you have an Nvidia GPU
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
# Using beta driver for recent GPUs like RTX 4070
|
||||
nvidiaDriverChannel = config.boot.kernelPackages.nvidiaPackages.production;
|
||||
in {
|
||||
# Video drivers configuration for Xorg and Wayland
|
||||
services.xserver.videoDrivers = ["nvidia"]; # Simplified - other modules are loaded automatically
|
||||
|
||||
# Kernel parameters for better Wayland and Hyprland integration
|
||||
boot.kernelParams = [
|
||||
"nvidia-drm.modeset=1" # Enable mode setting for Wayland
|
||||
"nvidia.NVreg_PreserveVideoMemoryAllocations=1" # Improves resume after sleep
|
||||
];
|
||||
|
||||
# Blacklist nouveau to avoid conflicts
|
||||
boot.blacklistedKernelModules = ["nouveau"];
|
||||
|
||||
# Environment variables for better compatibility
|
||||
environment.variables = {
|
||||
LIBVA_DRIVER_NAME = "nvidia"; # Hardware video acceleration
|
||||
GBM_BACKEND = "nvidia-drm"; # Graphics backend for Wayland
|
||||
__GLX_VENDOR_LIBRARY_NAME = "nvidia"; # Use Nvidia driver for GLX
|
||||
NIXOS_OZONE_WL = "1"; # Wayland support for Electron apps
|
||||
__GL_GSYNC_ALLOWED = "1"; # Enable G-Sync if available
|
||||
__GL_VRR_ALLOWED = "1"; # Enable VRR (Variable Refresh Rate)
|
||||
NVD_BACKEND = "direct"; # Configuration for new driver
|
||||
MOZ_ENABLE_WAYLAND = "1"; # Wayland support for Firefox
|
||||
};
|
||||
|
||||
# Configuration for proprietary packages
|
||||
nixpkgs.config = {
|
||||
nvidia.acceptLicense = true;
|
||||
};
|
||||
|
||||
# Nvidia configuration
|
||||
hardware = {
|
||||
nvidia = {
|
||||
open = false; # Proprietary driver for better performance
|
||||
nvidiaSettings = true; # Nvidia settings utility
|
||||
powerManagement = {
|
||||
enable = true; # Power management
|
||||
finegrained = true; # More precise power consumption control
|
||||
};
|
||||
modesetting.enable = true; # Required for Wayland
|
||||
package = nvidiaDriverChannel;
|
||||
forceFullCompositionPipeline = true; # Prevents screen tearing
|
||||
|
||||
# Configuration for hybrid AMD+Nvidia laptop
|
||||
prime = {
|
||||
# Optimized configuration for switchable graphics laptops
|
||||
offload = {
|
||||
enable = true; # Mode optimized for power saving
|
||||
enableOffloadCmd = true; # Allows running applications with dedicated GPU
|
||||
};
|
||||
# sync.enable disabled as offload is generally better for laptops
|
||||
sync.enable = false;
|
||||
# PCI IDs verified for your hardware
|
||||
amdgpuBusId = "PCI:5:0:0"; # Integrated AMD GPU
|
||||
nvidiaBusId = "PCI:1:0:0"; # Dedicated Nvidia GPU
|
||||
};
|
||||
};
|
||||
|
||||
# Enhanced graphics support
|
||||
graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
extraPackages = with pkgs; [
|
||||
nvidia-vaapi-driver
|
||||
libva-vdpau-driver
|
||||
libvdpau-va-gl
|
||||
mesa
|
||||
egl-wayland
|
||||
vulkan-loader
|
||||
vulkan-validation-layers
|
||||
libva
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Nix cache for CUDA
|
||||
nix.settings = {
|
||||
substituters = ["https://cuda-maintainers.cachix.org"];
|
||||
trusted-public-keys = [
|
||||
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
|
||||
];
|
||||
};
|
||||
|
||||
# Additional useful packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
vulkan-tools
|
||||
mesa-demos
|
||||
libva-utils # VA-API debugging tools
|
||||
];
|
||||
|
||||
# Enable Nvidia container toolkit for GPU acceleration in containers (docker)
|
||||
hardware.nvidia-container-toolkit.enable = false;
|
||||
}
|
||||
Reference in New Issue
Block a user