init(release): desktop template -> desktop wip

This commit is contained in:
Rasyidan Akbar F. 2025-10-24 11:08:12 +07:00
commit 5bc78a031f
22 changed files with 716 additions and 11 deletions

14
modules/nixos/audio.nix Normal file
View file

@ -0,0 +1,14 @@
{ lib, ... }:
{
# Modern audio stack - PipeWire replaces PulseAudio + JACK + ALSA
services.pipewire = {
enable = lib.mkDefault true;
alsa.enable = lib.mkDefault true;
alsa.support32Bit = lib.mkDefault true; # For 32-bit games/apps
pulse.enable = lib.mkDefault true; # PulseAudio compatibility
jack.enable = lib.mkDefault true; # JACK compatibility
};
# Real-time audio priority
security.rtkit.enable = lib.mkDefault true;
}

View file

@ -0,0 +1,13 @@
{ lib, ... }:
{
hardware.bluetooth = {
enable = lib.mkDefault false; # Enable when needed
powerOnBoot = lib.mkDefault true;
settings = {
General = {
Enable = "Source,Sink,Media,Socket";
Experimental = true; # Better codec support
};
};
};
}

View file

@ -0,0 +1,34 @@
# Desktop Environments
This directory contains system-level desktop environment configurations.
## 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)
## Usage
Import one desktop environment in your host configuration:
```nix
# modules/nixos/hosts/your-host.nix
{
imports = [
../desktops/hyprland.nix
# OR
# ../desktops/plasma.nix
# OR
# ../desktops/niri.nix
];
}
```
## Adding a New Desktop Environment
1. Create a new file (e.g., `gnome.nix`)
2. Import `./base.nix`
3. Enable the desktop environment
4. Add essential system packages

View file

@ -0,0 +1,28 @@
{ lib, pkgs, ... }:
{
# Shared desktop settings (imported by all DEs)
# XDG portals for desktop integration
xdg.portal = {
enable = lib.mkDefault true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
# Policy kit for privilege escalation
security.polkit.enable = lib.mkDefault true;
# GVFS for trash, mounting, etc
services.gvfs.enable = lib.mkDefault true;
# Common desktop packages
environment.systemPackages = with pkgs; [
# File managers (choose one)
# nautilus # GNOME
# dolphin # KDE
# thunar # XFCE
# Basic utilities
pavucontrol # Audio control
networkmanagerapplet # Network management GUI
];
}

View file

@ -0,0 +1,31 @@
{ 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,28 @@
{ 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

@ -0,0 +1,16 @@
{ lib, ... }:
{
imports = [ ./base.nix ];
# KDE Plasma 6
services.desktopManager.plasma6.enable = lib.mkDefault true;
# SDDM display manager
services.displayManager.sddm = {
enable = lib.mkDefault true;
wayland.enable = lib.mkDefault true;
};
# KDE apps are managed by Plasma
# Add extra packages in your host config if needed
}

40
modules/nixos/fonts.nix Normal file
View file

@ -0,0 +1,40 @@
{ lib, pkgs, ... }:
{
fonts = {
enableDefaultPackages = lib.mkDefault true;
packages = with pkgs; [
# Nerd Fonts for terminal icons
(nerdfonts.override {
fonts = [
"FiraCode"
"JetBrainsMono"
"Iosevka"
];
})
# Core fonts
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
liberation_ttf
# Code fonts
fira-code
jetbrains-mono
];
fontconfig = {
enable = lib.mkDefault true;
defaultFonts = {
monospace = [
"JetBrains Mono"
"FiraCode Nerd Font"
];
sansSerif = [ "Noto Sans" ];
serif = [ "Noto Serif" ];
emoji = [ "Noto Color Emoji" ];
};
};
};
}

View file

@ -0,0 +1,22 @@
{ lib, pkgs, ... }:
{
# Hardware acceleration (OpenGL/Vulkan)
hardware.graphics = {
enable = lib.mkDefault true;
enable32Bit = lib.mkDefault true; # For 32-bit games/apps
extraPackages = with pkgs; [
# Common drivers (expand based on your hardware)
mesa.drivers
vulkan-validation-layers
vulkan-tools
# Intel-specific (comment out if not using Intel)
intel-media-driver
intel-vaapi-driver
# AMD-specific (comment out if not using AMD)
# rocmPackages.clr.icd
];
};
}

View file

@ -0,0 +1,24 @@
{ ... }:
{
# Desktop user configuration (for Hyprland/Niri setups)
imports = [
# Base CLI tools
../../home/rsydn/base.nix
# Desktop additions
../../home/rsydn/desktop/base.nix
../../home/rsydn/desktop/apps/browsers.nix
../../home/rsydn/desktop/apps/terminals.nix
# Choose your compositor
../../home/rsydn/desktop/wayland
# Enable specific compositor in wayland/default.nix
# Add theme when ready
# ../../home/rsydn/desktop/themes/catppuccin.nix
];
# Override options here
# programs.kitty.enable = true;
}

View file

@ -0,0 +1,32 @@
{ pkgs, ... }:
{
# Gaming user configuration (for KDE Plasma)
imports = [
# Base CLI tools
../../home/rsydn/base.nix
# Desktop base
../../home/rsydn/desktop/base.nix
../../home/rsydn/desktop/apps/browsers.nix
];
# Gaming-specific user packages
home.packages = with pkgs; [
# Communication
# discord
# teamspeak_client
# Streaming/Recording
# obs-studio
# Media
# spotify
];
# KDE-specific settings (optional)
# programs.plasma = {
# enable = true;
# workspace.theme = "breeze-dark";
# };
}

View file

@ -0,0 +1,42 @@
{ pkgs, ... }:
{
# Example desktop development workstation configuration
# Copy and modify for your actual hardware
# Boot configuration (adjust for your system)
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Hostname
networking.hostName = "desktop-dev";
# Import desktop environment (choose one)
imports = [
../desktops/hyprland.nix
# ../desktops/plasma.nix
# ../desktops/niri.nix
];
# Hardware-specific settings (adjust for your hardware)
# boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
# GPU drivers (uncomment if using NVIDIA)
# services.xserver.videoDrivers = [ "nvidia" ];
# hardware.nvidia = {
# modesetting.enable = true;
# open = false; # Use proprietary driver
# };
# Optional: Enable bluetooth
# hardware.bluetooth.enable = true;
# Development-specific packages
environment.systemPackages = with pkgs; [
# Add desktop dev tools here
# docker-compose
# k9s
];
# This value determines the NixOS release compatibility
system.stateVersion = "24.05";
}

View file

@ -0,0 +1,53 @@
{ pkgs, ... }:
{
# Example gaming desktop configuration
# Copy and modify for your actual hardware
# Boot configuration
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Hostname
networking.hostName = "gaming-rig";
# Import KDE Plasma for gaming
imports = [ ../desktops/plasma.nix ];
# Gaming-specific settings
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
# GameMode for performance optimization
programs.gamemode.enable = true;
# GPU drivers (example: NVIDIA)
# services.xserver.videoDrivers = [ "nvidia" ];
# hardware.nvidia = {
# modesetting.enable = true;
# powerManagement.enable = false;
# open = false;
# package = config.boot.kernelPackages.nvidiaPackages.stable;
# };
# Gaming packages
environment.systemPackages = with pkgs; [
# Launchers
lutris
heroic
# bottles
# Tools
mangohud # FPS overlay
# gamescope # Gaming compositor
# protonup-qt # Proton version manager
# Communication
discord
];
# This value determines the NixOS release compatibility
system.stateVersion = "24.05";
}