fix: dev vm enhacement, switch podman
This commit is contained in:
commit
831f307f83
70 changed files with 2977 additions and 962 deletions
13
modules/nixos/audio.nix
Normal file
13
modules/nixos/audio.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ 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;
|
||||
}
|
||||
12
modules/nixos/bluetooth.nix
Normal file
12
modules/nixos/bluetooth.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ 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
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,15 +1,46 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, pkgs, user, ... }:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkOption mkIf types mkMerge mkAfter optionals;
|
||||
inherit (lib)
|
||||
mkEnableOption mkOption mkIf types mkMerge mkAfter optionals mkDefault;
|
||||
cfg = config.rsydn.containerization;
|
||||
in {
|
||||
options.rsydn.containerization = {
|
||||
docker = {
|
||||
podman = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description =
|
||||
"Enable the Docker daemon with sane defaults for development.";
|
||||
"Enable Podman for rootless containers as the primary engine.";
|
||||
};
|
||||
|
||||
dockerCompat = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description =
|
||||
"Expose the Docker-compatible socket for CLI compatibility.";
|
||||
};
|
||||
|
||||
enableDnsnamePlugin = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description =
|
||||
"Enable the dnsname CNI plugin so containers can resolve each other.";
|
||||
};
|
||||
|
||||
extraPackages = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = with pkgs; [ podman-compose podman-tui ];
|
||||
description =
|
||||
"Additional Podman-related packages to install system-wide.";
|
||||
};
|
||||
};
|
||||
|
||||
docker = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description =
|
||||
"Enable the Docker daemon alongside Podman when explicitly requested.";
|
||||
};
|
||||
|
||||
autoPrune = mkOption {
|
||||
|
|
@ -58,6 +89,27 @@ in {
|
|||
};
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf cfg.podman.enable {
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
dockerCompat = cfg.podman.dockerCompat;
|
||||
defaultNetwork.settings.dnsname.enable = cfg.podman.enableDnsnamePlugin;
|
||||
};
|
||||
|
||||
environment.systemPackages = mkAfter cfg.podman.extraPackages;
|
||||
|
||||
users.users.${user} = {
|
||||
subUidRanges = mkDefault [{
|
||||
startUid = 100000;
|
||||
count = 65536;
|
||||
}];
|
||||
subGidRanges = mkDefault [{
|
||||
startGid = 100000;
|
||||
count = 65536;
|
||||
}];
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.docker.enable {
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
|
|
|
|||
176
modules/nixos/desktops/README.md
Normal file
176
modules/nixos/desktops/README.md
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
# Desktop Environments
|
||||
|
||||
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
|
||||
|
||||
### 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/plasma.nix
|
||||
# OR
|
||||
# ../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` 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
|
||||
```
|
||||
8
modules/nixos/desktops/apps/browsers.nix
Normal file
8
modules/nixos/desktops/apps/browsers.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{ pkgs, user, ... }: {
|
||||
# Browser configurations for desktop users
|
||||
|
||||
home-manager.users.${user} = {
|
||||
# User packages: Browsers
|
||||
home.packages = with pkgs; [ brave ];
|
||||
};
|
||||
}
|
||||
114
modules/nixos/desktops/apps/terminals.nix
Normal file
114
modules/nixos/desktops/apps/terminals.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
27
modules/nixos/desktops/base.nix
Normal file
27
modules/nixos/desktops/base.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ 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
|
||||
];
|
||||
}
|
||||
76
modules/nixos/desktops/gaming.nix
Normal file
76
modules/nixos/desktops/gaming.nix
Normal 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; };
|
||||
}
|
||||
78
modules/nixos/desktops/hardware-configuration.nix
Normal file
78
modules/nixos/desktops/hardware-configuration.nix
Normal 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";
|
||||
}
|
||||
71
modules/nixos/desktops/hyprland/default.nix
Normal file
71
modules/nixos/desktops/hyprland/default.nix
Normal 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
|
||||
];
|
||||
};
|
||||
}
|
||||
42
modules/nixos/desktops/plasma.nix
Normal file
42
modules/nixos/desktops/plasma.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ lib, pkgs, user, ... }: {
|
||||
imports = [ ./base.nix ];
|
||||
|
||||
# System-level: 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;
|
||||
};
|
||||
|
||||
# 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
|
||||
];
|
||||
};
|
||||
}
|
||||
64
modules/nixos/desktops/themes/catppuccin.nix
Normal file
64
modules/nixos/desktops/themes/catppuccin.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
33
modules/nixos/desktops/themes/default.nix
Normal file
33
modules/nixos/desktops/themes/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
30
modules/nixos/fonts.nix
Normal file
30
modules/nixos/fonts.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ 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" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
21
modules/nixos/graphics.nix
Normal file
21
modules/nixos/graphics.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ 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
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -1,3 +1,18 @@
|
|||
{ config, pkgs, lib, ... }: {
|
||||
imports = [ ../../home/rsydn/base.nix ../../home/rsydn/shell/fish.nix ];
|
||||
# Minimal CLI-only Home Manager configuration
|
||||
# Used for servers, VMs, and headless systems
|
||||
# Desktop configs are handled directly in nixos/desktops/* modules
|
||||
|
||||
imports = [
|
||||
../../home/rsydn/base.nix # Base CLI tools (git, tmux, etc.)
|
||||
../../home/rsydn/shell/fish.nix # Shell configuration
|
||||
../../home/rsydn/shell/nushell.nix # Secondary Nushell setup
|
||||
];
|
||||
|
||||
config.programs.tmux.extraConfig = lib.mkAfter ''
|
||||
# Prefer fish for interactive sessions; launch Nushell on demand.
|
||||
set -g default-shell "${config.home.profileDirectory}/bin/fish"
|
||||
set -g default-command "${config.home.profileDirectory}/bin/fish --login"
|
||||
bind-key C-n new-window -n nushell "${config.home.profileDirectory}/bin/nu --login"
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
48
modules/nixos/hosts/desktop.nix
Normal file
48
modules/nixos/hosts/desktop.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{ lib, pkgs, ... }:
|
||||
let
|
||||
hardwareConfigPath = builtins.toString ./.
|
||||
+ "/../desktops/hardware-configuration.nix";
|
||||
hardwareModule = if builtins.pathExists hardwareConfigPath then
|
||||
import hardwareConfigPath
|
||||
else
|
||||
(_: { });
|
||||
in {
|
||||
# Unified desktop configuration for gaming and development
|
||||
# Includes both KDE Plasma and Hyprland - switch at login screen
|
||||
|
||||
# Import hardware and desktop configurations
|
||||
imports = [
|
||||
# Hardware
|
||||
hardwareModule
|
||||
|
||||
# Audio & Graphics
|
||||
../audio.nix
|
||||
../graphics.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 # Or use themes/default.nix for Adwaita
|
||||
|
||||
# Gaming & Features
|
||||
../desktops/gaming.nix
|
||||
../bluetooth.nix
|
||||
];
|
||||
|
||||
# Boot configuration with CachyOS LTS kernel
|
||||
boot = {
|
||||
loader.systemd-boot.enable = true;
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
kernelPackages = pkgs.linuxPackages_cachyos-lts;
|
||||
};
|
||||
|
||||
# Hostname
|
||||
networking.hostName = "desktop";
|
||||
|
||||
# This value determines the NixOS release compatibility
|
||||
system.stateVersion = "24.05";
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Core utilities
|
||||
coreutils
|
||||
ast-grep
|
||||
ripgrep
|
||||
|
|
@ -21,12 +22,30 @@
|
|||
tree
|
||||
zip
|
||||
unzip
|
||||
htop
|
||||
jq
|
||||
psmisc # provides killall and friends
|
||||
gh
|
||||
tree-sitter
|
||||
|
||||
# System monitoring & debugging tools
|
||||
htop # Process viewer
|
||||
iotop # I/O monitoring
|
||||
lsof # List open files
|
||||
strace # System call tracing
|
||||
ltrace # Library call tracing
|
||||
gdb # GNU debugger
|
||||
tcpdump # Network packet analyzer
|
||||
ncdu # Disk usage analyzer
|
||||
];
|
||||
|
||||
services.qemuGuest.enable = true;
|
||||
|
||||
services.openssh.openFirewall = false;
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ ];
|
||||
interfaces."tailscale0".allowedTCPPorts = [ 22 ];
|
||||
};
|
||||
|
||||
imports = [ ../virtualization.nix ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
{ lib, ... }: {
|
||||
{ lib, user, ... }: {
|
||||
imports = [ ./users.nix ./network.nix ./ssh.nix ./containerization.nix ];
|
||||
|
||||
nix = {
|
||||
settings.auto-optimise-store = lib.mkDefault true;
|
||||
settings.experimental-features = lib.mkDefault [ "nix-command" "flakes" ];
|
||||
settings.trusted-users = lib.mkDefault [ "root" user ];
|
||||
optimise.automatic = lib.mkDefault true;
|
||||
gc = {
|
||||
automatic = lib.mkDefault true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue