letting it auto run pretty much, god i don't know how to program anymore. This is kinda a joke

This commit is contained in:
theArctesian
2025-09-24 17:59:50 -07:00
parent 742eda3fe5
commit eb5f9ef7da
22 changed files with 2253 additions and 262 deletions

146
modules/colors.nix Normal file
View File

@@ -0,0 +1,146 @@
{ config, pkgs, lib, inputs, ... }:
with lib;
let
cfg = config.omnixy;
omnixy = import ./helpers.nix { inherit config pkgs lib; };
# Function to generate colors from wallpaper using imagemagick
generateColorsFromWallpaper = wallpaperPath: pkgs.writeShellScriptBin "generate-colors" ''
#!/usr/bin/env bash
# Extract dominant colors from wallpaper using imagemagick
colors=$(${pkgs.imagemagick}/bin/convert "${wallpaperPath}" -resize 1x1 -format "%[pixel:u]" info:)
# Generate a simple color scheme based on the dominant color
# This is a simplified approach - ideally would use a more sophisticated algorithm
echo "# Generated color scheme from wallpaper: ${wallpaperPath}"
echo "# Dominant color: $colors"
# For now, we'll use predefined schemes that match common wallpaper types
# In a real implementation, this would analyze the image and generate appropriate colors
'';
# Default color schemes for common wallpaper types
fallbackColorSchemes = {
dark = inputs.nix-colors.colorSchemes.tokyo-night-dark or null;
light = inputs.nix-colors.colorSchemes.tokyo-night-light or null;
blue = inputs.nix-colors.colorSchemes.nord or null;
purple = inputs.nix-colors.colorSchemes.catppuccin-mocha or null;
green = inputs.nix-colors.colorSchemes.gruvbox-dark-medium or null;
};
# Select color scheme based on wallpaper or user preference
selectedColorScheme =
if cfg.colorScheme != null then
cfg.colorScheme
else if cfg.wallpaper != null && cfg.features.autoColors then
# TODO: Implement actual color analysis
# For now, use a sensible default based on theme
fallbackColorSchemes.${cfg.theme} or fallbackColorSchemes.dark
else
# Use theme-based color scheme
fallbackColorSchemes.${cfg.theme} or fallbackColorSchemes.dark;
in
{
config = mkIf (cfg.enable or true) (mkMerge [
# User-specific configuration using shared helpers
(omnixy.forUser (mkIf (selectedColorScheme != null) {
colorScheme = selectedColorScheme;
# Add packages for color management
home.packages = omnixy.filterPackages (with pkgs; [
imagemagick # For color extraction from images
] ++ optionals (omnixy.isEnabled "customThemes" || omnixy.isEnabled "wallpaperEffects") [
# Additional packages for advanced color analysis
python3Packages.pillow # For more sophisticated image analysis
python3Packages.colorthief # For extracting color palettes
] ++ optionals (cfg.wallpaper != null) [
# Generate wallpaper setter script that respects colors
(omnixy.makeScript "set-omnixy-wallpaper" "Set wallpaper with automatic color generation" ''
WALLPAPER_PATH="${cfg.wallpaper}"
echo "Setting wallpaper: $WALLPAPER_PATH"
# Set wallpaper with swww
if command -v swww &> /dev/null; then
swww img "$WALLPAPER_PATH" --transition-type wipe --transition-angle 30 --transition-step 90
else
echo "swww not found, please install swww for wallpaper support"
fi
# Optionally generate new colors from wallpaper
${optionalString (omnixy.isEnabled "wallpaperEffects") ''
echo "Generating colors from wallpaper..."
# This would trigger a system rebuild with new colors
# For now, just notify the user
echo "Note: Automatic color generation requires system rebuild"
echo "Consider adding this wallpaper to your configuration and rebuilding"
''}
'')
]);
}))
# System-level configuration
{
# System-level packages for color management
environment.systemPackages = with pkgs; [
# Color utilities
imagemagick
# Wallpaper utilities
swww # Wayland wallpaper daemon
# Script to help users set up automatic colors
(writeShellScriptBin "omnixy-setup-colors" ''
#!/usr/bin/env bash
echo "OmniXY Color Setup"
echo "=================="
echo ""
echo "Current configuration:"
echo " Theme: ${cfg.theme}"
echo " Preset: ${if cfg.preset != null then cfg.preset else "none"}"
echo " Custom Themes: ${if cfg.features.customThemes or false then "enabled" else "disabled"}"
echo " Wallpaper Effects: ${if cfg.features.wallpaperEffects or false then "enabled" else "disabled"}"
echo " Wallpaper: ${if cfg.wallpaper != null then toString cfg.wallpaper else "not set"}"
echo " Color Scheme: ${if cfg.colorScheme != null then "custom" else "theme-based"}"
echo ""
${optionalString (!(cfg.features.wallpaperEffects or false)) ''
echo "To enable automatic color generation:"
echo " 1. Set omnixy.features.wallpaperEffects = true; in your configuration"
echo " 2. Set omnixy.wallpaper = /path/to/your/wallpaper.jpg;"
echo " 3. Rebuild your system with: omnixy-rebuild"
echo ""
''}
${optionalString ((cfg.features.wallpaperEffects or false) && cfg.wallpaper == null) ''
echo "Wallpaper effects are enabled but no wallpaper is set."
echo "Set omnixy.wallpaper = /path/to/your/wallpaper.jpg; in your configuration."
echo ""
''}
echo "Available nix-colors schemes:"
echo " - tokyo-night-dark, tokyo-night-light"
echo " - catppuccin-mocha, catppuccin-latte"
echo " - gruvbox-dark-medium, gruvbox-light-medium"
echo " - nord"
echo " - everforest-dark-medium"
echo " - rose-pine, rose-pine-dawn"
echo ""
echo "To use a specific scheme:"
echo ' omnixy.colorScheme = inputs.nix-colors.colorSchemes.SCHEME_NAME;'
'')
];
# Export color information for other modules to use
environment.variables = mkIf (selectedColorScheme != null) {
OMNIXY_COLOR_SCHEME = selectedColorScheme.slug or "unknown";
};
}
]);
}

View File

@@ -9,27 +9,130 @@ in
options.omnixy = {
enable = mkEnableOption "OmniXY system configuration";
# User Configuration
user = mkOption {
type = types.str;
default = "user";
description = "Primary user for the system";
example = "john";
};
# Theme Configuration
theme = mkOption {
type = types.enum [ "tokyo-night" "catppuccin" "gruvbox" "nord" "everforest" "rose-pine" "kanagawa" ];
default = "tokyo-night";
description = "System theme";
description = "System theme - changes colors, wallpaper, and overall look";
example = "catppuccin";
};
# User-friendly theme aliases
darkMode = mkOption {
type = types.bool;
default = true;
description = "Use dark theme variant when available";
};
displayManager = mkOption {
type = types.enum [ "gdm" "tuigreet" ];
default = "tuigreet";
description = "Display manager to use for login";
};
colorScheme = mkOption {
type = types.nullOr types.attrs;
default = null;
description = "Color scheme from nix-colors. If null, uses theme-specific colors.";
example = "inputs.nix-colors.colorSchemes.tokyo-night-dark";
};
wallpaper = mkOption {
type = types.nullOr types.path;
default = null;
description = "Path to wallpaper for automatic color generation";
};
# Feature Categories - Simple on/off switches for major functionality
features = {
docker = mkEnableOption "Docker container support";
development = mkEnableOption "Development tools and environments";
gaming = mkEnableOption "Gaming support (Steam, Wine, etc.)";
multimedia = mkEnableOption "Multimedia applications";
# Development
coding = mkEnableOption "Development tools, editors, and programming languages";
containers = mkEnableOption "Docker and container support";
# Entertainment
gaming = mkEnableOption "Gaming support with Steam, Wine, and performance tools";
media = mkEnableOption "Video players, image viewers, and media editing tools";
# Productivity
office = mkEnableOption "Office suite, PDF viewers, and productivity apps";
communication = mkEnableOption "Chat apps, email clients, and video conferencing";
# System
virtualization = mkEnableOption "VM support (VirtualBox, QEMU, etc.)";
backup = mkEnableOption "Backup tools and cloud sync applications";
# Appearance
customThemes = mkEnableOption "Advanced theming with nix-colors integration";
wallpaperEffects = mkEnableOption "Dynamic wallpapers and color generation";
};
# Simple Presets - Predefined feature combinations
preset = mkOption {
type = types.nullOr (types.enum [ "minimal" "developer" "creator" "gamer" "office" "everything" ]);
default = null;
description = ''
Quick setup preset that automatically enables related features:
- minimal: Just the basics (browser, terminal, file manager)
- developer: Coding tools, containers, git, IDEs
- creator: Media editing, design tools, content creation
- gamer: Gaming support, performance tools, Discord
- office: Productivity apps, office suite, communication
- everything: All features enabled
'';
example = "developer";
};
};
config = mkIf cfg.enable {
# Apply preset configurations automatically
omnixy.features = mkMerge [
# Default features based on preset
(mkIf (cfg.preset == "minimal") {
# Only basic features
})
(mkIf (cfg.preset == "developer") {
coding = mkDefault true;
containers = mkDefault true;
customThemes = mkDefault true;
})
(mkIf (cfg.preset == "creator") {
media = mkDefault true;
office = mkDefault true;
customThemes = mkDefault true;
wallpaperEffects = mkDefault true;
})
(mkIf (cfg.preset == "gamer") {
gaming = mkDefault true;
media = mkDefault true;
communication = mkDefault true;
})
(mkIf (cfg.preset == "office") {
office = mkDefault true;
communication = mkDefault true;
backup = mkDefault true;
})
(mkIf (cfg.preset == "everything") {
coding = mkDefault true;
containers = mkDefault true;
gaming = mkDefault true;
media = mkDefault true;
office = mkDefault true;
communication = mkDefault true;
virtualization = mkDefault true;
backup = mkDefault true;
customThemes = mkDefault true;
wallpaperEffects = mkDefault true;
})
];
# Basic system configuration
system.autoUpgrade = {
enable = true;
@@ -42,7 +145,7 @@ in
documentation = {
enable = true;
man.enable = true;
dev.enable = cfg.features.development;
dev.enable = cfg.features.coding or false;
};
# Security settings
@@ -106,8 +209,6 @@ in
};
};
# Enable flatpak support
flatpak.enable = true;
# System monitoring
smartd = {
@@ -126,8 +227,6 @@ in
# OpenGL support
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
intel-media-driver
vaapiIntel
@@ -138,7 +237,7 @@ in
};
# Docker configuration
virtualisation = mkIf cfg.features.docker {
virtualisation = mkIf (cfg.features.containers or false) {
docker = {
enable = true;
enableOnBoot = true;
@@ -149,21 +248,24 @@ in
};
};
# Development configuration
programs = mkIf cfg.features.development {
git = {
# Programs configuration
programs = {
# Development programs
git = mkIf (cfg.features.coding or false) {
enable = true;
lfs.enable = true;
};
npm.enable = true;
};
npm = mkIf (cfg.features.coding or false) {
enable = true;
};
# Gaming configuration
programs.steam = mkIf cfg.features.gaming {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
# Gaming configuration
steam = mkIf (cfg.features.gaming or false) {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
};
# Environment variables
@@ -279,7 +381,7 @@ in
# Development basics
git
make
gnumake
gcc
# Nix tools
@@ -290,20 +392,40 @@ in
# Custom OmniXY scripts
(writeShellScriptBin "omnixy-info" ''
#!/usr/bin/env bash
echo "OmniXY NixOS"
echo "============"
echo "Version: ${config.omnixy.version or "1.0.0"}"
echo "Theme: ${cfg.theme}"
echo "User: ${cfg.user}"
echo "🌟 OmniXY NixOS Configuration"
echo "============================="
echo ""
echo "Features:"
echo " Docker: ${if cfg.features.docker then "" else ""}"
echo " Development: ${if cfg.features.development then "" else ""}"
echo " Gaming: ${if cfg.features.gaming then "" else ""}"
echo " Multimedia: ${if cfg.features.multimedia then "" else ""}"
echo "📋 Basic Settings:"
echo " User: ${cfg.user}"
echo " Theme: ${cfg.theme}"
echo " Preset: ${if cfg.preset != null then cfg.preset else "custom"}"
echo " Display Manager: ${cfg.displayManager}"
echo ""
echo "System Info:"
nixos-version
echo "🎯 Active Features:"
echo " Development: ${if cfg.features.coding or false then "" else ""}"
echo " Containers: ${if cfg.features.containers or false then "" else ""}"
echo " Gaming: ${if cfg.features.gaming or false then "" else ""}"
echo " Media: ${if cfg.features.media or false then "" else ""}"
echo " Office: ${if cfg.features.office or false then "" else ""}"
echo " Communication: ${if cfg.features.communication or false then "" else ""}"
echo " Virtualization: ${if cfg.features.virtualization or false then "" else ""}"
echo " Backup: ${if cfg.features.backup or false then "" else ""}"
echo ""
echo "🎨 Theming:"
echo " Custom Themes: ${if cfg.features.customThemes or false then "" else ""}"
echo " Wallpaper Effects: ${if cfg.features.wallpaperEffects or false then "" else ""}"
echo " Color Scheme: ${if cfg.colorScheme != null then "Custom" else "Theme-based"}"
echo " Wallpaper: ${if cfg.wallpaper != null then toString cfg.wallpaper else "Not set"}"
echo ""
echo "💡 Quick Commands:"
echo " omnixy-setup-colors - Configure colors and themes"
echo " omnixy-rebuild - Rebuild system configuration"
echo " omnixy-help - Show keyboard shortcuts and help"
echo ""
echo "📊 System Information:"
nixos-version --json | ${pkgs.jq}/bin/jq -r '" NixOS: " + .nixosVersion'
echo " Kernel: $(uname -r)"
echo " Uptime: $(uptime -p)"
'')
];
};

View File

@@ -18,7 +18,7 @@ in
defaultTerminal = mkOption {
type = types.str;
default = "alacritty";
default = "ghostty";
description = "Default terminal emulator";
};
@@ -29,9 +29,9 @@ in
};
wallpaper = mkOption {
type = types.path;
default = ./wallpapers/default.jpg;
description = "Path to wallpaper image";
type = types.nullOr types.path;
default = null;
description = "Path to wallpaper image (optional)";
};
};
@@ -262,11 +262,11 @@ in
mouse_move_enables_dpms = true
key_press_enables_dpms = true
enable_swallow = true
swallow_regex = ^(alacritty|kitty|footclient)$
swallow_regex = ^(ghostty|alacritty|kitty|footclient)$
}
# Window rules
windowrulev2 = opacity 0.9 override 0.9 override, class:^(Alacritty|kitty)$
windowrulev2 = opacity 0.9 override 0.9 override, class:^(ghostty|Alacritty|kitty)$
windowrulev2 = opacity 0.9 override 0.9 override, class:^(Code|code-oss)$
windowrulev2 = float, class:^(pavucontrol|nm-connection-editor|blueman-manager)$
windowrulev2 = float, class:^(org.gnome.Calculator|gnome-calculator)$

View File

@@ -3,10 +3,11 @@
with lib;
let
cfg = config.omnixy.features.development;
cfg = config.omnixy;
omnixy = import ./helpers.nix { inherit config pkgs lib; };
in
{
config = mkIf cfg {
config = omnixy.withFeature "coding" {
# Development tools
environment.systemPackages = with pkgs; [
# Version control
@@ -102,7 +103,7 @@ in
sqlite
redis
mongodb
dbeaver
dbeaver-bin
# Container tools
docker
@@ -179,100 +180,10 @@ in
tmuxinator
asciinema
tokei
loc
cloc
tree-sitter
];
# Docker daemon
virtualisation.docker = {
enable = true;
enableOnBoot = true;
daemon.settings = {
features = { buildkit = true; };
registry-mirrors = [ "https://mirror.gcr.io" ];
};
autoPrune = {
enable = true;
dates = "weekly";
flags = [ "--all" ];
};
};
# Podman as Docker alternative
virtualisation.podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
};
# Development services
services = {
# PostgreSQL
postgresql = {
enable = false; # Set to true to enable
package = pkgs.postgresql_15;
dataDir = "/var/lib/postgresql/15";
authentication = ''
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
'';
};
# Redis
redis.servers."" = {
enable = false; # Set to true to enable
port = 6379;
bind = "127.0.0.1";
};
# MySQL/MariaDB
mysql = {
enable = false; # Set to true to enable
package = pkgs.mariadb;
settings = {
mysqld = {
bind-address = "127.0.0.1";
port = 3306;
};
};
};
};
# VSCode settings
environment.variables = {
# Enable VSCode to use Wayland
NIXOS_OZONE_WL = "1";
};
# Development shell environments
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
# Git configuration
programs.git = {
enable = true;
lfs.enable = true;
config = {
init.defaultBranch = "main";
core = {
editor = "nvim";
autocrlf = "input";
};
pull.rebase = false;
push.autoSetupRemote = true;
};
};
# Enable lorri for automatic nix-shell
services.lorri.enable = true;
# Add custom development scripts
environment.systemPackages = with pkgs; [
# Custom development scripts
(writeShellScriptBin "dev-postgres" ''
#!/usr/bin/env bash
echo "Starting PostgreSQL development container..."
@@ -471,5 +382,93 @@ in
echo "Run 'direnv allow' to activate the development environment"
'')
];
# Docker daemon (only if containers feature is enabled)
virtualisation.docker = mkIf (omnixy.isEnabled "containers") {
enable = true;
enableOnBoot = true;
daemon.settings = {
features = { buildkit = true; };
registry-mirrors = [ "https://mirror.gcr.io" ];
};
autoPrune = {
enable = true;
dates = "weekly";
flags = [ "--all" ];
};
};
# Podman as Docker alternative (disabled dockerCompat to avoid conflict)
virtualisation.podman = {
enable = true;
dockerCompat = false;
defaultNetwork.settings.dns_enabled = true;
};
# Development services
services = {
# PostgreSQL
postgresql = {
enable = false; # Set to true to enable
package = pkgs.postgresql_15;
dataDir = "/var/lib/postgresql/15";
authentication = ''
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
'';
};
# Redis
redis.servers."" = {
enable = false; # Set to true to enable
port = 6379;
bind = "127.0.0.1";
};
# MySQL/MariaDB
mysql = {
enable = false; # Set to true to enable
package = pkgs.mariadb;
settings = {
mysqld = {
bind-address = "127.0.0.1";
port = 3306;
};
};
};
};
# VSCode settings
environment.variables = {
# Enable VSCode to use Wayland
NIXOS_OZONE_WL = "1";
};
# Development shell environments
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
# Git configuration
programs.git = {
enable = true;
lfs.enable = true;
config = {
init.defaultBranch = "main";
core = {
editor = "nvim";
autocrlf = "input";
};
pull.rebase = false;
push.autoSetupRemote = true;
};
};
# Enable lorri for automatic nix-shell
services.lorri.enable = true;
};
}

35
modules/hardware/amd.nix Normal file
View File

@@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
with lib;
{
options.hardware.amd.enable = mkEnableOption "AMD graphics support";
config = mkIf config.hardware.amd.enable {
# AMD driver configuration
services.xserver.videoDrivers = [ "amdgpu" ];
# Enable AMD GPU support
boot.initrd.kernelModules = [ "amdgpu" ];
# AMD specific packages
environment.systemPackages = with pkgs; [
radeontop
nvtopPackages.amd
];
# OpenGL packages for AMD
hardware.opengl.extraPackages = with pkgs; [
amdvlk
rocm-opencl-icd
rocm-opencl-runtime
];
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [
driversi686Linux.amdvlk
];
# AMD GPU firmware
hardware.enableRedistributableFirmware = true;
};
}

View File

@@ -0,0 +1,42 @@
{ config, lib, pkgs, ... }:
with lib;
{
options.hardware.audio.pipewire.enable = mkEnableOption "PipeWire audio system";
config = mkIf config.hardware.audio.pipewire.enable {
# PipeWire configuration
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
# Audio packages
environment.systemPackages = with pkgs; [
# Audio control
pavucontrol
pulsemixer
alsamixer
# Audio tools
audacity
pulseaudio
# Bluetooth audio
bluez
bluez-tools
];
# Disable PulseAudio (conflicts with PipeWire)
hardware.pulseaudio.enable = false;
# Audio group for user
users.groups.audio = {};
};
}

View File

@@ -0,0 +1,45 @@
{ config, lib, pkgs, ... }:
with lib;
{
options.hardware.bluetooth.enhanced.enable = mkEnableOption "Enhanced Bluetooth support";
config = mkIf config.hardware.bluetooth.enhanced.enable {
# Enable Bluetooth
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
Enable = "Source,Sink,Media,Socket";
Experimental = true;
};
};
};
# Bluetooth services
services.blueman.enable = true;
# Bluetooth packages
environment.systemPackages = with pkgs; [
bluez
bluez-tools
blueman
bluetuith
];
# Auto-connect trusted devices
systemd.user.services.bluetooth-auto-connect = {
description = "Auto-connect Bluetooth devices";
after = [ "bluetooth.service" ];
partOf = [ "bluetooth.service" ];
serviceConfig = {
Type = "forking";
ExecStart = "${pkgs.bluez}/bin/bluetoothctl connect-all";
RemainAfterExit = true;
};
wantedBy = [ "default.target" ];
};
};
}

View File

@@ -14,8 +14,7 @@ with lib;
# Common hardware support
hardware = {
# Enable all firmware
enableAllFirmware = true;
# Enable redistributable firmware only
enableRedistributableFirmware = true;
# CPU microcode updates
@@ -25,8 +24,6 @@ with lib;
# OpenGL/Graphics
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
# Common OpenGL packages
extraPackages = with pkgs; [
@@ -50,8 +47,16 @@ with lib;
# Sensor support (for laptops)
sensor.iio.enable = true;
# Firmware updater
fwupd.enable = true;
# Scanner support
sane = {
enable = true;
extraBackends = with pkgs; [
sane-airscan
epkowa
];
};
# Firmware updater (moved to services section)
};
# Kernel modules
@@ -80,8 +85,6 @@ with lib;
# Power profiles daemon (modern power management)
power-profiles-daemon.enable = true;
# Firmware update service
fwupd.enable = true;
# Hardware monitoring
smartd = {
@@ -112,11 +115,9 @@ with lib;
hwinfo
inxi
dmidecode
lscpu
lsusb
lspci
pciutils
usbutils
util-linux # provides lscpu
pciutils # provides lspci
usbutils # provides lsusb
# Disk tools
smartmontools
@@ -164,7 +165,7 @@ with lib;
# Virtual console configuration
console = {
earlySetup = true;
font = "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz";
font = lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz";
packages = [ pkgs.terminus_font ];
};
}

View File

@@ -0,0 +1,39 @@
{ config, lib, pkgs, ... }:
with lib;
{
options.hardware.intel.enable = mkEnableOption "Intel graphics support";
config = mkIf config.hardware.intel.enable {
# Intel driver configuration
services.xserver.videoDrivers = [ "modesetting" ];
# Enable Intel GPU support
boot.initrd.kernelModules = [ "i915" ];
# Intel GPU early loading
boot.kernelParams = [ "i915.enable_guc=2" ];
# Intel specific packages
environment.systemPackages = with pkgs; [
intel-gpu-tools
nvtopPackages.intel
];
# OpenGL packages for Intel (already configured in default.nix)
hardware.opengl.extraPackages = with pkgs; [
intel-media-driver
vaapiIntel
intel-compute-runtime
intel-ocl
];
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [
vaapiIntel
];
# Intel GPU power management
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
};
}

View File

@@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
with lib;
{
options.hardware.nvidia.enable = mkEnableOption "NVIDIA graphics support";
config = mkIf config.hardware.nvidia.enable {
# NVIDIA driver configuration
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
# NVIDIA specific packages
environment.systemPackages = with pkgs; [
nvidia-vaapi-driver
libva-utils
nvtopPackages.nvidia
];
# OpenGL packages for NVIDIA
hardware.opengl.extraPackages = with pkgs; [
nvidia-vaapi-driver
vaapiVdpau
libvdpau-va-gl
];
};
}

View File

@@ -0,0 +1,45 @@
{ config, lib, pkgs, ... }:
with lib;
{
options.hardware.touchpad.enable = mkEnableOption "Enhanced touchpad support";
config = mkIf config.hardware.touchpad.enable {
# Touchpad support via libinput
services.xserver.libinput = {
enable = true;
touchpad = {
tapping = true;
tappingDragLock = true;
naturalScrolling = true;
scrollMethod = "twofinger";
disableWhileTyping = true;
middleEmulation = true;
accelProfile = "adaptive";
};
};
# Synaptics touchpad (alternative, disabled by default)
services.xserver.synaptics = {
enable = false;
twoFingerScroll = true;
palmDetect = true;
tapButtons = true;
buttonsMap = [ 1 3 2 ];
fingersMap = [ 0 0 0 ];
};
# Touchpad packages
environment.systemPackages = with pkgs; [
libinput
xinput
xorg.xf86inputlibinput
];
# Touchpad gesture support
services.touchegg = {
enable = false; # Disabled by default, enable if needed
};
};
}

125
modules/helpers.nix Normal file
View File

@@ -0,0 +1,125 @@
{ config, pkgs, lib, ... }:
# OmniXY Shared Helper Functions
# Import this in other modules to access common patterns
with lib;
let
cfg = config.omnixy;
in
{
# Check if a feature is enabled, with fallback support
isEnabled = feature: cfg.features.${feature} or false;
# Get user-specific paths
userPath = path: "/home/${cfg.user}/${path}";
configPath = path: "/home/${cfg.user}/.config/${path}";
cachePath = path: "/home/${cfg.user}/.cache/${path}";
# Common color helper that works with both nix-colors and fallbacks
getColor = colorName: fallback:
if cfg.colorScheme != null && cfg.colorScheme ? colors && cfg.colorScheme.colors ? ${colorName}
then "#${cfg.colorScheme.colors.${colorName}}"
else fallback;
# Feature-based conditional inclusion
withFeature = feature: content: mkIf (cfg.features.${feature} or false) content;
withoutFeature = feature: content: mkIf (!(cfg.features.${feature} or false)) content;
# User-specific home-manager configuration
forUser = userConfig: {
home-manager.users.${cfg.user} = userConfig;
};
# Package filtering with exclusion support
filterPackages = packages:
builtins.filter (pkg:
let name = pkg.name or pkg.pname or "unknown";
in !(builtins.elem name (cfg.packages.exclude or []))
) packages;
# Create a standardized script with OmniXY branding
makeScript = name: description: script: pkgs.writeShellScriptBin name ''
#!/usr/bin/env bash
# ${description}
# Part of OmniXY NixOS configuration
set -euo pipefail
${script}
'';
# Standard paths for OmniXY
paths = {
config = "/etc/nixos";
logs = "/var/log/omnixy";
cache = "/var/cache/omnixy";
runtime = "/run/omnixy";
};
# Color scheme mappings (base16 colors to semantic names)
colors = {
# Background colors
bg = "#1a1b26"; # Primary background
bgAlt = "#16161e"; # Alternative background
bgAccent = "#2f3549"; # Accent background
# Foreground colors
fg = "#c0caf5"; # Primary foreground
fgAlt = "#9aa5ce"; # Alternative foreground
fgDim = "#545c7e"; # Dimmed foreground
# Accent colors (Tokyo Night defaults, can be overridden by themes)
red = "#f7768e"; # Error/danger
orange = "#ff9e64"; # Warning
yellow = "#e0af68"; # Attention
green = "#9ece6a"; # Success
cyan = "#7dcfff"; # Info
blue = "#7aa2f7"; # Primary accent
purple = "#bb9af7"; # Secondary accent
brown = "#db4b4b"; # Tertiary accent
};
# Standard application categories for consistent organization
categories = {
system = [ "file managers" "terminals" "system monitors" ];
development = [ "editors" "version control" "compilers" "debuggers" ];
multimedia = [ "media players" "image viewers" "audio tools" "video editors" ];
productivity = [ "office suites" "note taking" "calendars" "email" ];
communication = [ "messaging" "video calls" "social media" ];
gaming = [ "game launchers" "emulators" "performance tools" ];
utilities = [ "calculators" "converters" "system tools" ];
};
# Standard service patterns
service = {
# Create a basic systemd service with OmniXY defaults
make = name: serviceConfig: {
description = serviceConfig.description or "OmniXY ${name} service";
wantedBy = serviceConfig.wantedBy or [ "multi-user.target" ];
after = serviceConfig.after or [ "network.target" ];
serviceConfig = {
Type = serviceConfig.type or "simple";
User = serviceConfig.user or cfg.user;
Group = serviceConfig.group or "users";
Restart = serviceConfig.restart or "on-failure";
RestartSec = serviceConfig.restartSec or "5";
} // (serviceConfig.serviceConfig or {});
};
# Create a user service
user = name: serviceConfig: {
home-manager.users.${cfg.user}.systemd.user.services.${name} = {
description = serviceConfig.description or "OmniXY ${name} user service";
wantedBy = [ "default.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = serviceConfig.type or "simple";
Restart = serviceConfig.restart or "on-failure";
RestartSec = serviceConfig.restartSec or "5";
} // (serviceConfig.serviceConfig or {});
};
};
};
}

195
modules/lib.nix Normal file
View File

@@ -0,0 +1,195 @@
{ config, pkgs, lib, ... }:
# Shared library module for OmniXY
# Provides common utilities, helpers, and patterns for other modules
with lib;
let
cfg = config.omnixy;
# Helper functions for common patterns
helpers = {
# Check if a feature is enabled, with fallback support
isEnabled = feature: cfg.features.${feature} or false;
# Get user-specific paths
userPath = path: "/home/${cfg.user}/${path}";
configPath = path: "/home/${cfg.user}/.config/${path}";
cachePath = path: "/home/${cfg.user}/.cache/${path}";
# Common color helper that works with both nix-colors and fallbacks
getColor = colorName: fallback:
if cfg.colorScheme != null && cfg.colorScheme ? colors && cfg.colorScheme.colors ? ${colorName}
then "#${cfg.colorScheme.colors.${colorName}}"
else fallback;
# Feature-based conditional inclusion
withFeature = feature: content: mkIf (helpers.isEnabled feature) content;
withoutFeature = feature: content: mkIf (!helpers.isEnabled feature) content;
# User-specific home-manager configuration
forUser = userConfig: {
home-manager.users.${cfg.user} = userConfig;
};
# Package filtering with exclusion support
filterPackages = packages:
builtins.filter (pkg:
let name = pkg.name or pkg.pname or "unknown";
in !(builtins.elem name (cfg.packages.exclude or []))
) packages;
# Create a standardized script with OmniXY branding
makeScript = name: description: script: pkgs.writeShellScriptBin name ''
#!/usr/bin/env bash
# ${description}
# Part of OmniXY NixOS configuration
set -euo pipefail
${script}
'';
# Standard paths for OmniXY
paths = {
config = "/etc/nixos";
logs = "/var/log/omnixy";
cache = "/var/cache/omnixy";
runtime = "/run/omnixy";
};
# Color scheme mappings (base16 colors to semantic names)
colors = {
# Background colors
bg = "#1a1b26"; # Primary background
bgAlt = "#16161e"; # Alternative background
bgAccent = "#2f3549"; # Accent background
# Foreground colors
fg = "#c0caf5"; # Primary foreground
fgAlt = "#9aa5ce"; # Alternative foreground
fgDim = "#545c7e"; # Dimmed foreground
# Accent colors (Tokyo Night defaults, can be overridden by themes)
red = "#f7768e"; # Error/danger
orange = "#ff9e64"; # Warning
yellow = "#e0af68"; # Attention
green = "#9ece6a"; # Success
cyan = "#7dcfff"; # Info
blue = "#7aa2f7"; # Primary accent
purple = "#bb9af7"; # Secondary accent
brown = "#db4b4b"; # Tertiary accent
};
# Standard application categories for consistent organization
categories = {
system = [ "file managers" "terminals" "system monitors" ];
development = [ "editors" "version control" "compilers" "debuggers" ];
multimedia = [ "media players" "image viewers" "audio tools" "video editors" ];
productivity = [ "office suites" "note taking" "calendars" "email" ];
communication = [ "messaging" "video calls" "social media" ];
gaming = [ "game launchers" "emulators" "performance tools" ];
utilities = [ "calculators" "converters" "system tools" ];
};
# Standard service patterns
service = {
# Create a basic systemd service with OmniXY defaults
make = name: serviceConfig: {
description = serviceConfig.description or "OmniXY ${name} service";
wantedBy = serviceConfig.wantedBy or [ "multi-user.target" ];
after = serviceConfig.after or [ "network.target" ];
serviceConfig = {
Type = serviceConfig.type or "simple";
User = serviceConfig.user or cfg.user;
Group = serviceConfig.group or "users";
Restart = serviceConfig.restart or "on-failure";
RestartSec = serviceConfig.restartSec or "5";
} // (serviceConfig.serviceConfig or {});
};
# Create a user service
user = name: serviceConfig: {
home-manager.users.${cfg.user}.systemd.user.services.${name} = (mkHelpers cfg).service.make name (serviceConfig // {
wantedBy = [ "default.target" ];
after = [ "graphical-session.target" ];
});
};
};
};
in
{
# Export shared configuration for other modules
config = {
# Ensure required directories exist
systemd.tmpfiles.rules = [
"d ${helpers.paths.logs} 0755 root root -"
"d ${helpers.paths.cache} 0755 root root -"
"d ${helpers.paths.runtime} 0755 root root -"
"d ${helpers.userPath ".local/bin"} 0755 ${cfg.user} users -"
"d ${helpers.userPath ".local/share/omnixy"} 0755 ${cfg.user} users -"
];
# Global environment variables that all modules can use
environment.variables = {
OMNIXY_USER = cfg.user;
OMNIXY_THEME = cfg.theme;
OMNIXY_PRESET = cfg.preset or "custom";
OMNIXY_CONFIG_DIR = helpers.paths.config;
OMNIXY_CACHE_DIR = helpers.paths.cache;
};
# Standard shell aliases that work consistently across modules
programs.bash.shellAliases = {
# OmniXY management
omnixy-rebuild = "sudo nixos-rebuild switch --flake ${helpers.paths.config}#omnixy";
omnixy-build = "sudo nixos-rebuild build --flake ${helpers.paths.config}#omnixy";
omnixy-test = "sudo nixos-rebuild test --flake ${helpers.paths.config}#omnixy";
omnixy-update = "cd ${helpers.paths.config} && sudo nix flake update";
omnixy-clean = "sudo nix-collect-garbage -d && nix-collect-garbage -d";
omnixy-generations = "sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
# System information
omnixy-status = "omnixy-info";
omnixy-features = "echo 'Enabled features:' && omnixy-info | grep -A 10 'Active Features'";
# Quick navigation
omnixy-config = "cd ${helpers.paths.config}";
omnixy-logs = "cd ${helpers.paths.logs}";
};
# Provide a global package for accessing OmniXY utilities
environment.systemPackages = [
(helpers.makeScript "omnixy-lib-test" "Test OmniXY library functions" ''
echo "🧪 OmniXY Library Test"
echo "===================="
echo ""
echo "Configuration:"
echo " User: ${cfg.user}"
echo " Theme: ${cfg.theme}"
echo " Preset: ${cfg.preset or "none"}"
echo ""
echo "Colors (base16 scheme):"
echo " Background: ${helpers.colors.bg}"
echo " Foreground: ${helpers.colors.fg}"
echo " Primary: ${helpers.colors.blue}"
echo " Success: ${helpers.colors.green}"
echo " Warning: ${helpers.colors.yellow}"
echo " Error: ${helpers.colors.red}"
echo ""
echo "Paths:"
echo " Config: ${helpers.paths.config}"
echo " Logs: ${helpers.paths.logs}"
echo " Cache: ${helpers.paths.cache}"
echo " User home: ${helpers.userPath ""}"
echo ""
echo "Features:"
${concatStringsSep "\n" (mapAttrsToList (name: enabled:
''echo " ${name}: ${if enabled then "" else ""}"''
) cfg.features)}
'')
];
};
}

View File

@@ -4,22 +4,30 @@ with lib;
let
cfg = config.omnixy;
omnixy = import ./helpers.nix { inherit config pkgs lib; };
in
{
options.omnixy.packages = {
enable = mkEnableOption "OmniXY packages";
exclude = mkOption {
type = types.listOf types.str;
default = [];
example = [ "discord" "spotify" "steam" ];
description = "List of package names to exclude from installation";
};
categories = {
base = mkEnableOption "Base system packages" // { default = true; };
development = mkEnableOption "Development packages" // { default = true; };
multimedia = mkEnableOption "Multimedia packages" // { default = true; };
productivity = mkEnableOption "Productivity packages" // { default = true; };
gaming = mkEnableOption "Gaming packages" // { default = false; };
development = mkEnableOption "Development packages" // { default = omnixy.isEnabled "coding"; };
multimedia = mkEnableOption "Multimedia packages" // { default = omnixy.isEnabled "media"; };
productivity = mkEnableOption "Productivity packages" // { default = (omnixy.isEnabled "office" || omnixy.isEnabled "communication"); };
gaming = mkEnableOption "Gaming packages" // { default = omnixy.isEnabled "gaming"; };
};
};
config = mkIf (cfg.enable or true) {
environment.systemPackages = with pkgs;
environment.systemPackages = with pkgs; omnixy.filterPackages (
# Base system packages (always installed)
[
# Core utilities
@@ -66,8 +74,7 @@ in
# Text processing
vim
nano
sed
gnused
gawk
jq
yq-go
@@ -177,7 +184,7 @@ in
sqlite
redis
mongodb-tools
dbeaver
dbeaver-bin
# API testing
httpie
@@ -207,7 +214,6 @@ in
easyeffects
spotify
spotifyd
spotify-tui
cmus
mpd
ncmpcpp
@@ -216,7 +222,7 @@ in
mpv
vlc
obs-studio
kdenlive
kdePackages.kdenlive
handbrake
ffmpeg-full
@@ -239,7 +245,7 @@ in
# PDF
zathura
evince
okular
kdePackages.okular
mupdf
]
@@ -258,7 +264,7 @@ in
signal-desktop
element-desktop
zoom-us
teams
# teams not available on x86_64-linux
# Office
libreoffice
@@ -304,29 +310,26 @@ in
gamemode
discord
obs-studio
];
]
); # End of filterPackages
# Font packages
fonts.packages = with pkgs; [
# Nerd fonts (for icons in terminal)
(nerdfonts.override {
fonts = [
"JetBrainsMono"
"FiraCode"
"Hack"
"Iosevka"
"Meslo"
"SourceCodePro"
"UbuntuMono"
"DroidSansMono"
"RobotoMono"
"Inconsolata"
];
})
nerd-fonts.jetbrains-mono
nerd-fonts.fira-code
nerd-fonts.hack
nerd-fonts.iosevka
nerd-fonts.meslo-lg
nerd-fonts.sauce-code-pro
nerd-fonts.ubuntu-mono
nerd-fonts.droid-sans-mono
nerd-fonts.roboto-mono
nerd-fonts.inconsolata
# System fonts
noto-fonts
noto-fonts-cjk
noto-fonts-cjk-sans
noto-fonts-emoji
liberation_ttf
ubuntu_font_family
@@ -357,4 +360,4 @@ in
};
};
};
}
}

View File

@@ -6,21 +6,30 @@ let
cfg = config.omnixy;
in
{
# XDG Desktop Portals (required for Flatpak)
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk
];
config.common.default = "*";
};
# Tuigreet display manager (following omarchy-nix pattern)
services.greetd = {
enable = true;
settings.default_session.command = "${pkgs.tuigreet}/bin/tuigreet --time --cmd Hyprland";
};
# System services configuration
services = {
# Display server
xserver = {
enable = true;
# Display Manager
displayManager = {
gdm = {
enable = true;
wayland = true;
};
defaultSession = "hyprland";
};
# Display Manager disabled - using greetd instead
displayManager.gdm.enable = false;
# Touchpad support
libinput = {
@@ -52,14 +61,6 @@ in
];
};
# Scanner support
sane = {
enable = true;
extraBackends = with pkgs; [
sane-airscan
epkowa
];
};
# Sound
pipewire = {
@@ -110,7 +111,6 @@ in
enable = true;
interval = "daily";
package = pkgs.plocate;
localuser = null;
};
# Backup service (optional)

View File

@@ -1,50 +1,79 @@
{ config, pkgs, lib, ... }:
{ config, pkgs, lib, inputs, ... }:
let
cfg = config.omnixy;
# Use nix-colors if available and configured, otherwise fallback to manual colors
useNixColors = cfg.colorScheme != null;
colorScheme = cfg.colorScheme;
# Manual Tokyo Night colors as fallback
manualColors = {
bg = "#1a1b26";
fg = "#c0caf5";
accent = "#7aa2f7";
red = "#f7768e";
green = "#9ece6a";
yellow = "#e0af68";
blue = "#7aa2f7";
magenta = "#bb9af7";
cyan = "#7dcfff";
white = "#c0caf5";
black = "#15161e";
};
# Helper function to get color from scheme or fallback
getColor = name: fallback:
if useNixColors && colorScheme ? colors && colorScheme.colors ? ${name}
then "#${colorScheme.colors.${name}}"
else fallback;
in
{
# Tokyo Night theme configuration
config = {
# Color palette
# Color palette - use nix-colors if available
environment.variables = {
OMNIXY_THEME = "tokyo-night";
OMNIXY_THEME_BG = "#1a1b26";
OMNIXY_THEME_FG = "#c0caf5";
OMNIXY_THEME_ACCENT = "#7aa2f7";
OMNIXY_THEME_BG = getColor "base00" manualColors.bg;
OMNIXY_THEME_FG = getColor "base05" manualColors.fg;
OMNIXY_THEME_ACCENT = getColor "base0D" manualColors.accent;
};
# Home-manager theme configuration
home-manager.users.${config.omnixy.user or "user"} = {
# Alacritty theme
# Alacritty theme - dynamic colors based on nix-colors or fallback
programs.alacritty.settings.colors = {
primary = {
background = "#1a1b26";
foreground = "#c0caf5";
background = getColor "base00" manualColors.bg;
foreground = getColor "base05" manualColors.fg;
};
normal = {
black = "#15161e";
red = "#f7768e";
green = "#9ece6a";
yellow = "#e0af68";
blue = "#7aa2f7";
magenta = "#bb9af7";
cyan = "#7dcfff";
white = "#a9b1d6";
black = getColor "base00" manualColors.black;
red = getColor "base08" manualColors.red;
green = getColor "base0B" manualColors.green;
yellow = getColor "base0A" manualColors.yellow;
blue = getColor "base0D" manualColors.blue;
magenta = getColor "base0E" manualColors.magenta;
cyan = getColor "base0C" manualColors.cyan;
white = getColor "base05" manualColors.white;
};
bright = {
black = "#414868";
red = "#f7768e";
green = "#9ece6a";
yellow = "#e0af68";
blue = "#7aa2f7";
magenta = "#bb9af7";
cyan = "#7dcfff";
white = "#c0caf5";
black = getColor "base03" "#414868";
red = getColor "base08" manualColors.red;
green = getColor "base0B" manualColors.green;
yellow = getColor "base0A" manualColors.yellow;
blue = getColor "base0D" manualColors.blue;
magenta = getColor "base0E" manualColors.magenta;
cyan = getColor "base0C" manualColors.cyan;
white = getColor "base07" manualColors.fg;
};
indexed_colors = [
{ index = 16; color = "#ff9e64"; }
{ index = 17; color = "#db4b4b"; }
{ index = 16; color = getColor "base09" "#ff9e64"; }
{ index = 17; color = getColor "base0F" "#db4b4b"; }
];
};
@@ -250,7 +279,8 @@
(writeShellScriptBin "set-wallpaper" ''
#!/usr/bin/env bash
# Set Tokyo Night themed wallpaper
swww img ${./wallpapers/tokyo-night.jpg} --transition-type wipe --transition-angle 30 --transition-step 90
echo "Wallpaper functionality disabled - add wallpaper manually with swww"
echo "Usage: swww img /path/to/wallpaper.jpg --transition-type wipe --transition-angle 30"
'')
];
};

View File

@@ -63,15 +63,14 @@ in
# User environment
environment.systemPackages = with pkgs; [
# User management tools
shadow
passwd
shadow # provides passwd, useradd, etc.
# Session management
loginctl
systemd # provides loginctl
# User info
finger_bsd
id-utils
idutils
];
# User-specific services