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:
@@ -306,6 +306,10 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|||||||
- Theme configurations adapted from community themes and color schemes
|
- Theme configurations adapted from community themes and color schemes
|
||||||
- [Nix Flakes](https://nixos.wiki/wiki/Flakes) - for reproducible and composable configurations
|
- [Nix Flakes](https://nixos.wiki/wiki/Flakes) - for reproducible and composable configurations
|
||||||
|
|
||||||
|
## 🔗 Similar Projects
|
||||||
|
|
||||||
|
- [Omarchy Nix](https://github.com/henrysipp/omarchy-nix) - Another NixOS implementation of DHH's Omarchy with automatic theme generation from wallpapers
|
||||||
|
|
||||||
## 🔗 Links
|
## 🔗 Links
|
||||||
|
|
||||||
- [NixOS Manual](https://nixos.org/manual/nixos/stable/) - Official NixOS documentation
|
- [NixOS Manual](https://nixos.org/manual/nixos/stable/) - Official NixOS documentation
|
||||||
|
|||||||
@@ -16,8 +16,10 @@ in
|
|||||||
# Include the results of the hardware scan
|
# Include the results of the hardware scan
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|
||||||
# Omarchy modules
|
# OmniXY modules (lib must be first to provide helpers)
|
||||||
|
./modules/lib.nix
|
||||||
./modules/core.nix
|
./modules/core.nix
|
||||||
|
./modules/colors.nix
|
||||||
./modules/desktop/hyprland.nix
|
./modules/desktop/hyprland.nix
|
||||||
./modules/packages.nix
|
./modules/packages.nix
|
||||||
./modules/development.nix
|
./modules/development.nix
|
||||||
@@ -27,6 +29,9 @@ in
|
|||||||
./modules/hardware
|
./modules/hardware
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Allow unfree packages
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
# Enable flakes
|
# Enable flakes
|
||||||
nix = {
|
nix = {
|
||||||
settings = {
|
settings = {
|
||||||
@@ -67,8 +72,8 @@ in
|
|||||||
# Plymouth for boot splash
|
# Plymouth for boot splash
|
||||||
plymouth = {
|
plymouth = {
|
||||||
enable = true;
|
enable = true;
|
||||||
theme = "omnixy";
|
theme = "bgrt"; # Use default theme for now
|
||||||
themePackages = [ (pkgs.callPackage ./packages/plymouth-theme.nix {}) ];
|
# themePackages = [ (pkgs.callPackage ./packages/plymouth-theme.nix {}) ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Kernel
|
# Kernel
|
||||||
@@ -104,8 +109,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Sound
|
# Sound (deprecated option removed)
|
||||||
sound.enable = true;
|
|
||||||
hardware.pulseaudio.enable = false;
|
hardware.pulseaudio.enable = false;
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
@@ -121,13 +125,8 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
excludePackages = [ pkgs.xterm ];
|
excludePackages = [ pkgs.xterm ];
|
||||||
|
|
||||||
# Display manager
|
# Display manager disabled - using tuigreet in services.nix
|
||||||
displayManager = {
|
displayManager.gdm.enable = false;
|
||||||
gdm = {
|
|
||||||
enable = true;
|
|
||||||
wayland = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Console configuration
|
# Console configuration
|
||||||
@@ -146,14 +145,37 @@ in
|
|||||||
# Custom OmniXY settings
|
# Custom OmniXY settings
|
||||||
omnixy = {
|
omnixy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
user = "user"; # Change this to your username
|
||||||
theme = currentTheme;
|
theme = currentTheme;
|
||||||
|
displayManager = "tuigreet";
|
||||||
|
|
||||||
# Feature flags
|
# Quick Setup - Choose a preset that matches your use case
|
||||||
features = {
|
preset = "developer"; # Options: minimal, developer, creator, gamer, office, everything
|
||||||
docker = true;
|
|
||||||
development = true;
|
# Color scheme configuration (optional)
|
||||||
gaming = false;
|
# Uncomment and customize these options for automatic color generation:
|
||||||
multimedia = true;
|
# colorScheme = inputs.nix-colors.colorSchemes.tokyo-night-dark;
|
||||||
|
# wallpaper = /path/to/your/wallpaper.jpg;
|
||||||
|
|
||||||
|
# Fine-grained feature control (overrides preset settings)
|
||||||
|
# Uncomment and customize as needed:
|
||||||
|
# features = {
|
||||||
|
# coding = true; # Development tools, editors, programming languages
|
||||||
|
# containers = true; # Docker and container support
|
||||||
|
# gaming = false; # Steam, Wine, gaming performance tools
|
||||||
|
# media = true; # Video players, image viewers, media editing
|
||||||
|
# office = false; # Office suite, PDF viewers, productivity apps
|
||||||
|
# communication = false; # Chat apps, email, video conferencing
|
||||||
|
# virtualization = false; # VirtualBox, QEMU, VM tools
|
||||||
|
# backup = false; # Backup tools, cloud sync
|
||||||
|
# customThemes = true; # Advanced theming with nix-colors
|
||||||
|
# wallpaperEffects = true; # Dynamic wallpapers and color generation
|
||||||
|
# };
|
||||||
|
|
||||||
|
# Package management
|
||||||
|
packages = {
|
||||||
|
# Example: Exclude specific packages you don't want
|
||||||
|
# exclude = [ "discord" "spotify" "steam" "teams" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
1096
flake.lock
generated
Normal file
1096
flake.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
19
flake.nix
19
flake.nix
@@ -24,15 +24,17 @@
|
|||||||
inputs.hyprland.follows = "hyprland";
|
inputs.hyprland.follows = "hyprland";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Nix colors for automatic color scheme generation
|
||||||
|
nix-colors = {
|
||||||
|
url = "github:misterio77/nix-colors";
|
||||||
|
};
|
||||||
|
|
||||||
# Stylix for theming
|
# Stylix for theming
|
||||||
stylix = {
|
stylix = {
|
||||||
url = "github:danth/stylix";
|
url = "github:danth/stylix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Nix colors
|
|
||||||
nix-colors.url = "github:misterio77/nix-colors";
|
|
||||||
|
|
||||||
# Neovim nightly
|
# Neovim nightly
|
||||||
neovim-nightly-overlay = {
|
neovim-nightly-overlay = {
|
||||||
url = "github:nix-community/neovim-nightly-overlay";
|
url = "github:nix-community/neovim-nightly-overlay";
|
||||||
@@ -53,8 +55,8 @@
|
|||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
};
|
};
|
||||||
overlays = [
|
overlays = [
|
||||||
inputs.nur.overlay
|
inputs.nur.overlays.default
|
||||||
inputs.neovim-nightly-overlay.overlay
|
inputs.neovim-nightly-overlay.overlays.default
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
@@ -76,6 +78,9 @@
|
|||||||
# Replace with your username
|
# Replace with your username
|
||||||
user = import ./home.nix;
|
user = import ./home.nix;
|
||||||
};
|
};
|
||||||
|
sharedModules = [
|
||||||
|
inputs.nix-colors.homeManagerModules.default
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@@ -178,8 +183,8 @@
|
|||||||
# OmniXY scripts as packages
|
# OmniXY scripts as packages
|
||||||
omnixy-scripts = pkgs.callPackage ./packages/scripts.nix {};
|
omnixy-scripts = pkgs.callPackage ./packages/scripts.nix {};
|
||||||
|
|
||||||
# Plymouth theme
|
# Plymouth theme (disabled until package exists)
|
||||||
plymouth-theme-omnixy = pkgs.callPackage ./packages/plymouth-theme.nix {};
|
# plymouth-theme-omnixy = pkgs.callPackage ./packages/plymouth-theme.nix {};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Apps that can be run
|
# Apps that can be run
|
||||||
|
|||||||
25
home.nix
25
home.nix
@@ -16,6 +16,7 @@
|
|||||||
# Packages to install
|
# Packages to install
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# Terminal utilities
|
# Terminal utilities
|
||||||
|
ghostty
|
||||||
alacritty
|
alacritty
|
||||||
kitty
|
kitty
|
||||||
wezterm
|
wezterm
|
||||||
@@ -37,7 +38,7 @@
|
|||||||
# System monitoring
|
# System monitoring
|
||||||
btop
|
btop
|
||||||
htop
|
htop
|
||||||
nvtop
|
nvtopPackages.full
|
||||||
|
|
||||||
# Media
|
# Media
|
||||||
mpv
|
mpv
|
||||||
@@ -84,7 +85,9 @@
|
|||||||
wev
|
wev
|
||||||
|
|
||||||
# Fonts
|
# Fonts
|
||||||
(nerdfonts.override { fonts = [ "JetBrainsMono" "FiraCode" "Hack" ]; })
|
nerd-fonts.jetbrains-mono
|
||||||
|
nerd-fonts.fira-code
|
||||||
|
nerd-fonts.hack
|
||||||
noto-fonts
|
noto-fonts
|
||||||
noto-fonts-emoji
|
noto-fonts-emoji
|
||||||
liberation_ttf
|
liberation_ttf
|
||||||
@@ -182,23 +185,23 @@
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
character = {
|
character = {
|
||||||
success_symbol = "[➜](bold green)";
|
success_symbol = lib.mkDefault "[➜](bold green)";
|
||||||
error_symbol = "[➜](bold red)";
|
error_symbol = lib.mkDefault "[➜](bold red)";
|
||||||
};
|
};
|
||||||
|
|
||||||
directory = {
|
directory = {
|
||||||
truncation_length = 3;
|
truncation_length = 3;
|
||||||
truncate_to_repo = true;
|
truncate_to_repo = true;
|
||||||
style = "bold cyan";
|
style = lib.mkDefault "bold cyan";
|
||||||
};
|
};
|
||||||
|
|
||||||
git_branch = {
|
git_branch = {
|
||||||
style = "bold purple";
|
style = lib.mkDefault "bold purple";
|
||||||
symbol = " ";
|
symbol = " ";
|
||||||
};
|
};
|
||||||
|
|
||||||
git_status = {
|
git_status = {
|
||||||
style = "bold red";
|
style = lib.mkDefault "bold red";
|
||||||
ahead = "⇡\${count}";
|
ahead = "⇡\${count}";
|
||||||
diverged = "⇕⇡\${ahead_count}⇣\${behind_count}";
|
diverged = "⇕⇡\${ahead_count}⇣\${behind_count}";
|
||||||
behind = "⇣\${count}";
|
behind = "⇣\${count}";
|
||||||
@@ -298,7 +301,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
userSettings = {
|
userSettings = {
|
||||||
"workbench.colorTheme" = "One Dark Pro";
|
"workbench.colorTheme" = lib.mkDefault "One Dark Pro";
|
||||||
"workbench.iconTheme" = "material-icon-theme";
|
"workbench.iconTheme" = "material-icon-theme";
|
||||||
"editor.fontFamily" = "'JetBrainsMono Nerd Font', monospace";
|
"editor.fontFamily" = "'JetBrainsMono Nerd Font', monospace";
|
||||||
"editor.fontSize" = 14;
|
"editor.fontSize" = 14;
|
||||||
@@ -377,10 +380,10 @@
|
|||||||
gtk = {
|
gtk = {
|
||||||
enable = true;
|
enable = true;
|
||||||
theme = {
|
theme = {
|
||||||
name = "Catppuccin-Mocha-Standard-Blue-dark";
|
name = lib.mkDefault "Catppuccin-Mocha-Standard-Blue-dark";
|
||||||
package = pkgs.catppuccin-gtk.override {
|
package = lib.mkDefault (pkgs.catppuccin-gtk.override {
|
||||||
variant = "mocha";
|
variant = "mocha";
|
||||||
};
|
});
|
||||||
};
|
};
|
||||||
iconTheme = {
|
iconTheme = {
|
||||||
name = "Papirus-Dark";
|
name = "Papirus-Dark";
|
||||||
|
|||||||
146
modules/colors.nix
Normal file
146
modules/colors.nix
Normal 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";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
}
|
||||||
190
modules/core.nix
190
modules/core.nix
@@ -9,27 +9,130 @@ in
|
|||||||
options.omnixy = {
|
options.omnixy = {
|
||||||
enable = mkEnableOption "OmniXY system configuration";
|
enable = mkEnableOption "OmniXY system configuration";
|
||||||
|
|
||||||
|
# User Configuration
|
||||||
user = mkOption {
|
user = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "user";
|
default = "user";
|
||||||
description = "Primary user for the system";
|
description = "Primary user for the system";
|
||||||
|
example = "john";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Theme Configuration
|
||||||
theme = mkOption {
|
theme = mkOption {
|
||||||
type = types.enum [ "tokyo-night" "catppuccin" "gruvbox" "nord" "everforest" "rose-pine" "kanagawa" ];
|
type = types.enum [ "tokyo-night" "catppuccin" "gruvbox" "nord" "everforest" "rose-pine" "kanagawa" ];
|
||||||
default = "tokyo-night";
|
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 = {
|
features = {
|
||||||
docker = mkEnableOption "Docker container support";
|
# Development
|
||||||
development = mkEnableOption "Development tools and environments";
|
coding = mkEnableOption "Development tools, editors, and programming languages";
|
||||||
gaming = mkEnableOption "Gaming support (Steam, Wine, etc.)";
|
containers = mkEnableOption "Docker and container support";
|
||||||
multimedia = mkEnableOption "Multimedia applications";
|
|
||||||
|
# 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 {
|
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
|
# Basic system configuration
|
||||||
system.autoUpgrade = {
|
system.autoUpgrade = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -42,7 +145,7 @@ in
|
|||||||
documentation = {
|
documentation = {
|
||||||
enable = true;
|
enable = true;
|
||||||
man.enable = true;
|
man.enable = true;
|
||||||
dev.enable = cfg.features.development;
|
dev.enable = cfg.features.coding or false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Security settings
|
# Security settings
|
||||||
@@ -106,8 +209,6 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable flatpak support
|
|
||||||
flatpak.enable = true;
|
|
||||||
|
|
||||||
# System monitoring
|
# System monitoring
|
||||||
smartd = {
|
smartd = {
|
||||||
@@ -126,8 +227,6 @@ in
|
|||||||
# OpenGL support
|
# OpenGL support
|
||||||
opengl = {
|
opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
driSupport = true;
|
|
||||||
driSupport32Bit = true;
|
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
intel-media-driver
|
intel-media-driver
|
||||||
vaapiIntel
|
vaapiIntel
|
||||||
@@ -138,7 +237,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Docker configuration
|
# Docker configuration
|
||||||
virtualisation = mkIf cfg.features.docker {
|
virtualisation = mkIf (cfg.features.containers or false) {
|
||||||
docker = {
|
docker = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableOnBoot = true;
|
enableOnBoot = true;
|
||||||
@@ -149,21 +248,24 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Development configuration
|
# Programs configuration
|
||||||
programs = mkIf cfg.features.development {
|
programs = {
|
||||||
git = {
|
# Development programs
|
||||||
|
git = mkIf (cfg.features.coding or false) {
|
||||||
enable = true;
|
enable = true;
|
||||||
lfs.enable = true;
|
lfs.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
npm.enable = true;
|
npm = mkIf (cfg.features.coding or false) {
|
||||||
};
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
# Gaming configuration
|
# Gaming configuration
|
||||||
programs.steam = mkIf cfg.features.gaming {
|
steam = mkIf (cfg.features.gaming or false) {
|
||||||
enable = true;
|
enable = true;
|
||||||
remotePlay.openFirewall = true;
|
remotePlay.openFirewall = true;
|
||||||
dedicatedServer.openFirewall = true;
|
dedicatedServer.openFirewall = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
@@ -279,7 +381,7 @@ in
|
|||||||
|
|
||||||
# Development basics
|
# Development basics
|
||||||
git
|
git
|
||||||
make
|
gnumake
|
||||||
gcc
|
gcc
|
||||||
|
|
||||||
# Nix tools
|
# Nix tools
|
||||||
@@ -290,20 +392,40 @@ in
|
|||||||
# Custom OmniXY scripts
|
# Custom OmniXY scripts
|
||||||
(writeShellScriptBin "omnixy-info" ''
|
(writeShellScriptBin "omnixy-info" ''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
echo "OmniXY NixOS"
|
echo "🌟 OmniXY NixOS Configuration"
|
||||||
echo "============"
|
echo "============================="
|
||||||
echo "Version: ${config.omnixy.version or "1.0.0"}"
|
|
||||||
echo "Theme: ${cfg.theme}"
|
|
||||||
echo "User: ${cfg.user}"
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Features:"
|
echo "📋 Basic Settings:"
|
||||||
echo " Docker: ${if cfg.features.docker then "✓" else "✗"}"
|
echo " User: ${cfg.user}"
|
||||||
echo " Development: ${if cfg.features.development then "✓" else "✗"}"
|
echo " Theme: ${cfg.theme}"
|
||||||
echo " Gaming: ${if cfg.features.gaming then "✓" else "✗"}"
|
echo " Preset: ${if cfg.preset != null then cfg.preset else "custom"}"
|
||||||
echo " Multimedia: ${if cfg.features.multimedia then "✓" else "✗"}"
|
echo " Display Manager: ${cfg.displayManager}"
|
||||||
echo ""
|
echo ""
|
||||||
echo "System Info:"
|
echo "🎯 Active Features:"
|
||||||
nixos-version
|
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)"
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ in
|
|||||||
|
|
||||||
defaultTerminal = mkOption {
|
defaultTerminal = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "alacritty";
|
default = "ghostty";
|
||||||
description = "Default terminal emulator";
|
description = "Default terminal emulator";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -29,9 +29,9 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
wallpaper = mkOption {
|
wallpaper = mkOption {
|
||||||
type = types.path;
|
type = types.nullOr types.path;
|
||||||
default = ./wallpapers/default.jpg;
|
default = null;
|
||||||
description = "Path to wallpaper image";
|
description = "Path to wallpaper image (optional)";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -262,11 +262,11 @@ in
|
|||||||
mouse_move_enables_dpms = true
|
mouse_move_enables_dpms = true
|
||||||
key_press_enables_dpms = true
|
key_press_enables_dpms = true
|
||||||
enable_swallow = true
|
enable_swallow = true
|
||||||
swallow_regex = ^(alacritty|kitty|footclient)$
|
swallow_regex = ^(ghostty|alacritty|kitty|footclient)$
|
||||||
}
|
}
|
||||||
|
|
||||||
# Window rules
|
# 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 = opacity 0.9 override 0.9 override, class:^(Code|code-oss)$
|
||||||
windowrulev2 = float, class:^(pavucontrol|nm-connection-editor|blueman-manager)$
|
windowrulev2 = float, class:^(pavucontrol|nm-connection-editor|blueman-manager)$
|
||||||
windowrulev2 = float, class:^(org.gnome.Calculator|gnome-calculator)$
|
windowrulev2 = float, class:^(org.gnome.Calculator|gnome-calculator)$
|
||||||
|
|||||||
@@ -3,10 +3,11 @@
|
|||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.omnixy.features.development;
|
cfg = config.omnixy;
|
||||||
|
omnixy = import ./helpers.nix { inherit config pkgs lib; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = mkIf cfg {
|
config = omnixy.withFeature "coding" {
|
||||||
# Development tools
|
# Development tools
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Version control
|
# Version control
|
||||||
@@ -102,7 +103,7 @@ in
|
|||||||
sqlite
|
sqlite
|
||||||
redis
|
redis
|
||||||
mongodb
|
mongodb
|
||||||
dbeaver
|
dbeaver-bin
|
||||||
|
|
||||||
# Container tools
|
# Container tools
|
||||||
docker
|
docker
|
||||||
@@ -179,100 +180,10 @@ in
|
|||||||
tmuxinator
|
tmuxinator
|
||||||
asciinema
|
asciinema
|
||||||
tokei
|
tokei
|
||||||
loc
|
|
||||||
cloc
|
cloc
|
||||||
tree-sitter
|
tree-sitter
|
||||||
];
|
|
||||||
|
|
||||||
# Docker daemon
|
# Custom development scripts
|
||||||
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; [
|
|
||||||
(writeShellScriptBin "dev-postgres" ''
|
(writeShellScriptBin "dev-postgres" ''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
echo "Starting PostgreSQL development container..."
|
echo "Starting PostgreSQL development container..."
|
||||||
@@ -471,5 +382,93 @@ in
|
|||||||
echo "Run 'direnv allow' to activate the development environment"
|
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
35
modules/hardware/amd.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
||||||
42
modules/hardware/audio.nix
Normal file
42
modules/hardware/audio.nix
Normal 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 = {};
|
||||||
|
};
|
||||||
|
}
|
||||||
45
modules/hardware/bluetooth.nix
Normal file
45
modules/hardware/bluetooth.nix
Normal 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" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -14,8 +14,7 @@ with lib;
|
|||||||
|
|
||||||
# Common hardware support
|
# Common hardware support
|
||||||
hardware = {
|
hardware = {
|
||||||
# Enable all firmware
|
# Enable redistributable firmware only
|
||||||
enableAllFirmware = true;
|
|
||||||
enableRedistributableFirmware = true;
|
enableRedistributableFirmware = true;
|
||||||
|
|
||||||
# CPU microcode updates
|
# CPU microcode updates
|
||||||
@@ -25,8 +24,6 @@ with lib;
|
|||||||
# OpenGL/Graphics
|
# OpenGL/Graphics
|
||||||
opengl = {
|
opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
driSupport = true;
|
|
||||||
driSupport32Bit = true;
|
|
||||||
|
|
||||||
# Common OpenGL packages
|
# Common OpenGL packages
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
@@ -50,8 +47,16 @@ with lib;
|
|||||||
# Sensor support (for laptops)
|
# Sensor support (for laptops)
|
||||||
sensor.iio.enable = true;
|
sensor.iio.enable = true;
|
||||||
|
|
||||||
# Firmware updater
|
# Scanner support
|
||||||
fwupd.enable = true;
|
sane = {
|
||||||
|
enable = true;
|
||||||
|
extraBackends = with pkgs; [
|
||||||
|
sane-airscan
|
||||||
|
epkowa
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Firmware updater (moved to services section)
|
||||||
};
|
};
|
||||||
|
|
||||||
# Kernel modules
|
# Kernel modules
|
||||||
@@ -80,8 +85,6 @@ with lib;
|
|||||||
# Power profiles daemon (modern power management)
|
# Power profiles daemon (modern power management)
|
||||||
power-profiles-daemon.enable = true;
|
power-profiles-daemon.enable = true;
|
||||||
|
|
||||||
# Firmware update service
|
|
||||||
fwupd.enable = true;
|
|
||||||
|
|
||||||
# Hardware monitoring
|
# Hardware monitoring
|
||||||
smartd = {
|
smartd = {
|
||||||
@@ -112,11 +115,9 @@ with lib;
|
|||||||
hwinfo
|
hwinfo
|
||||||
inxi
|
inxi
|
||||||
dmidecode
|
dmidecode
|
||||||
lscpu
|
util-linux # provides lscpu
|
||||||
lsusb
|
pciutils # provides lspci
|
||||||
lspci
|
usbutils # provides lsusb
|
||||||
pciutils
|
|
||||||
usbutils
|
|
||||||
|
|
||||||
# Disk tools
|
# Disk tools
|
||||||
smartmontools
|
smartmontools
|
||||||
@@ -164,7 +165,7 @@ with lib;
|
|||||||
# Virtual console configuration
|
# Virtual console configuration
|
||||||
console = {
|
console = {
|
||||||
earlySetup = true;
|
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 ];
|
packages = [ pkgs.terminus_font ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
39
modules/hardware/intel.nix
Normal file
39
modules/hardware/intel.nix
Normal 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";
|
||||||
|
};
|
||||||
|
}
|
||||||
35
modules/hardware/nvidia.nix
Normal file
35
modules/hardware/nvidia.nix
Normal 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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
45
modules/hardware/touchpad.nix
Normal file
45
modules/hardware/touchpad.nix
Normal 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
125
modules/helpers.nix
Normal 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
195
modules/lib.nix
Normal 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)}
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -4,22 +4,30 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.omnixy;
|
cfg = config.omnixy;
|
||||||
|
omnixy = import ./helpers.nix { inherit config pkgs lib; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.omnixy.packages = {
|
options.omnixy.packages = {
|
||||||
enable = mkEnableOption "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 = {
|
categories = {
|
||||||
base = mkEnableOption "Base system packages" // { default = true; };
|
base = mkEnableOption "Base system packages" // { default = true; };
|
||||||
development = mkEnableOption "Development packages" // { default = true; };
|
development = mkEnableOption "Development packages" // { default = omnixy.isEnabled "coding"; };
|
||||||
multimedia = mkEnableOption "Multimedia packages" // { default = true; };
|
multimedia = mkEnableOption "Multimedia packages" // { default = omnixy.isEnabled "media"; };
|
||||||
productivity = mkEnableOption "Productivity packages" // { default = true; };
|
productivity = mkEnableOption "Productivity packages" // { default = (omnixy.isEnabled "office" || omnixy.isEnabled "communication"); };
|
||||||
gaming = mkEnableOption "Gaming packages" // { default = false; };
|
gaming = mkEnableOption "Gaming packages" // { default = omnixy.isEnabled "gaming"; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf (cfg.enable or true) {
|
config = mkIf (cfg.enable or true) {
|
||||||
environment.systemPackages = with pkgs;
|
environment.systemPackages = with pkgs; omnixy.filterPackages (
|
||||||
# Base system packages (always installed)
|
# Base system packages (always installed)
|
||||||
[
|
[
|
||||||
# Core utilities
|
# Core utilities
|
||||||
@@ -66,8 +74,7 @@ in
|
|||||||
|
|
||||||
# Text processing
|
# Text processing
|
||||||
vim
|
vim
|
||||||
nano
|
gnused
|
||||||
sed
|
|
||||||
gawk
|
gawk
|
||||||
jq
|
jq
|
||||||
yq-go
|
yq-go
|
||||||
@@ -177,7 +184,7 @@ in
|
|||||||
sqlite
|
sqlite
|
||||||
redis
|
redis
|
||||||
mongodb-tools
|
mongodb-tools
|
||||||
dbeaver
|
dbeaver-bin
|
||||||
|
|
||||||
# API testing
|
# API testing
|
||||||
httpie
|
httpie
|
||||||
@@ -207,7 +214,6 @@ in
|
|||||||
easyeffects
|
easyeffects
|
||||||
spotify
|
spotify
|
||||||
spotifyd
|
spotifyd
|
||||||
spotify-tui
|
|
||||||
cmus
|
cmus
|
||||||
mpd
|
mpd
|
||||||
ncmpcpp
|
ncmpcpp
|
||||||
@@ -216,7 +222,7 @@ in
|
|||||||
mpv
|
mpv
|
||||||
vlc
|
vlc
|
||||||
obs-studio
|
obs-studio
|
||||||
kdenlive
|
kdePackages.kdenlive
|
||||||
handbrake
|
handbrake
|
||||||
ffmpeg-full
|
ffmpeg-full
|
||||||
|
|
||||||
@@ -239,7 +245,7 @@ in
|
|||||||
# PDF
|
# PDF
|
||||||
zathura
|
zathura
|
||||||
evince
|
evince
|
||||||
okular
|
kdePackages.okular
|
||||||
mupdf
|
mupdf
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -258,7 +264,7 @@ in
|
|||||||
signal-desktop
|
signal-desktop
|
||||||
element-desktop
|
element-desktop
|
||||||
zoom-us
|
zoom-us
|
||||||
teams
|
# teams not available on x86_64-linux
|
||||||
|
|
||||||
# Office
|
# Office
|
||||||
libreoffice
|
libreoffice
|
||||||
@@ -304,29 +310,26 @@ in
|
|||||||
gamemode
|
gamemode
|
||||||
discord
|
discord
|
||||||
obs-studio
|
obs-studio
|
||||||
];
|
]
|
||||||
|
); # End of filterPackages
|
||||||
|
|
||||||
# Font packages
|
# Font packages
|
||||||
fonts.packages = with pkgs; [
|
fonts.packages = with pkgs; [
|
||||||
# Nerd fonts (for icons in terminal)
|
# Nerd fonts (for icons in terminal)
|
||||||
(nerdfonts.override {
|
nerd-fonts.jetbrains-mono
|
||||||
fonts = [
|
nerd-fonts.fira-code
|
||||||
"JetBrainsMono"
|
nerd-fonts.hack
|
||||||
"FiraCode"
|
nerd-fonts.iosevka
|
||||||
"Hack"
|
nerd-fonts.meslo-lg
|
||||||
"Iosevka"
|
nerd-fonts.sauce-code-pro
|
||||||
"Meslo"
|
nerd-fonts.ubuntu-mono
|
||||||
"SourceCodePro"
|
nerd-fonts.droid-sans-mono
|
||||||
"UbuntuMono"
|
nerd-fonts.roboto-mono
|
||||||
"DroidSansMono"
|
nerd-fonts.inconsolata
|
||||||
"RobotoMono"
|
|
||||||
"Inconsolata"
|
|
||||||
];
|
|
||||||
})
|
|
||||||
|
|
||||||
# System fonts
|
# System fonts
|
||||||
noto-fonts
|
noto-fonts
|
||||||
noto-fonts-cjk
|
noto-fonts-cjk-sans
|
||||||
noto-fonts-emoji
|
noto-fonts-emoji
|
||||||
liberation_ttf
|
liberation_ttf
|
||||||
ubuntu_font_family
|
ubuntu_font_family
|
||||||
|
|||||||
@@ -6,21 +6,30 @@ let
|
|||||||
cfg = config.omnixy;
|
cfg = config.omnixy;
|
||||||
in
|
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
|
# System services configuration
|
||||||
services = {
|
services = {
|
||||||
# Display server
|
# Display server
|
||||||
xserver = {
|
xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
# Display Manager
|
# Display Manager disabled - using greetd instead
|
||||||
displayManager = {
|
displayManager.gdm.enable = false;
|
||||||
gdm = {
|
|
||||||
enable = true;
|
|
||||||
wayland = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
defaultSession = "hyprland";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Touchpad support
|
# Touchpad support
|
||||||
libinput = {
|
libinput = {
|
||||||
@@ -52,14 +61,6 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Scanner support
|
|
||||||
sane = {
|
|
||||||
enable = true;
|
|
||||||
extraBackends = with pkgs; [
|
|
||||||
sane-airscan
|
|
||||||
epkowa
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Sound
|
# Sound
|
||||||
pipewire = {
|
pipewire = {
|
||||||
@@ -110,7 +111,6 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
interval = "daily";
|
interval = "daily";
|
||||||
package = pkgs.plocate;
|
package = pkgs.plocate;
|
||||||
localuser = null;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Backup service (optional)
|
# Backup service (optional)
|
||||||
|
|||||||
@@ -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
|
# Tokyo Night theme configuration
|
||||||
config = {
|
config = {
|
||||||
# Color palette
|
# Color palette - use nix-colors if available
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
OMNIXY_THEME = "tokyo-night";
|
OMNIXY_THEME = "tokyo-night";
|
||||||
OMNIXY_THEME_BG = "#1a1b26";
|
OMNIXY_THEME_BG = getColor "base00" manualColors.bg;
|
||||||
OMNIXY_THEME_FG = "#c0caf5";
|
OMNIXY_THEME_FG = getColor "base05" manualColors.fg;
|
||||||
OMNIXY_THEME_ACCENT = "#7aa2f7";
|
OMNIXY_THEME_ACCENT = getColor "base0D" manualColors.accent;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Home-manager theme configuration
|
# Home-manager theme configuration
|
||||||
home-manager.users.${config.omnixy.user or "user"} = {
|
home-manager.users.${config.omnixy.user or "user"} = {
|
||||||
# Alacritty theme
|
# Alacritty theme - dynamic colors based on nix-colors or fallback
|
||||||
programs.alacritty.settings.colors = {
|
programs.alacritty.settings.colors = {
|
||||||
primary = {
|
primary = {
|
||||||
background = "#1a1b26";
|
background = getColor "base00" manualColors.bg;
|
||||||
foreground = "#c0caf5";
|
foreground = getColor "base05" manualColors.fg;
|
||||||
};
|
};
|
||||||
|
|
||||||
normal = {
|
normal = {
|
||||||
black = "#15161e";
|
black = getColor "base00" manualColors.black;
|
||||||
red = "#f7768e";
|
red = getColor "base08" manualColors.red;
|
||||||
green = "#9ece6a";
|
green = getColor "base0B" manualColors.green;
|
||||||
yellow = "#e0af68";
|
yellow = getColor "base0A" manualColors.yellow;
|
||||||
blue = "#7aa2f7";
|
blue = getColor "base0D" manualColors.blue;
|
||||||
magenta = "#bb9af7";
|
magenta = getColor "base0E" manualColors.magenta;
|
||||||
cyan = "#7dcfff";
|
cyan = getColor "base0C" manualColors.cyan;
|
||||||
white = "#a9b1d6";
|
white = getColor "base05" manualColors.white;
|
||||||
};
|
};
|
||||||
|
|
||||||
bright = {
|
bright = {
|
||||||
black = "#414868";
|
black = getColor "base03" "#414868";
|
||||||
red = "#f7768e";
|
red = getColor "base08" manualColors.red;
|
||||||
green = "#9ece6a";
|
green = getColor "base0B" manualColors.green;
|
||||||
yellow = "#e0af68";
|
yellow = getColor "base0A" manualColors.yellow;
|
||||||
blue = "#7aa2f7";
|
blue = getColor "base0D" manualColors.blue;
|
||||||
magenta = "#bb9af7";
|
magenta = getColor "base0E" manualColors.magenta;
|
||||||
cyan = "#7dcfff";
|
cyan = getColor "base0C" manualColors.cyan;
|
||||||
white = "#c0caf5";
|
white = getColor "base07" manualColors.fg;
|
||||||
};
|
};
|
||||||
|
|
||||||
indexed_colors = [
|
indexed_colors = [
|
||||||
{ index = 16; color = "#ff9e64"; }
|
{ index = 16; color = getColor "base09" "#ff9e64"; }
|
||||||
{ index = 17; color = "#db4b4b"; }
|
{ index = 17; color = getColor "base0F" "#db4b4b"; }
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -250,7 +279,8 @@
|
|||||||
(writeShellScriptBin "set-wallpaper" ''
|
(writeShellScriptBin "set-wallpaper" ''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Set Tokyo Night themed wallpaper
|
# 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"
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -63,15 +63,14 @@ in
|
|||||||
# User environment
|
# User environment
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# User management tools
|
# User management tools
|
||||||
shadow
|
shadow # provides passwd, useradd, etc.
|
||||||
passwd
|
|
||||||
|
|
||||||
# Session management
|
# Session management
|
||||||
loginctl
|
systemd # provides loginctl
|
||||||
|
|
||||||
# User info
|
# User info
|
||||||
finger_bsd
|
finger_bsd
|
||||||
id-utils
|
idutils
|
||||||
];
|
];
|
||||||
|
|
||||||
# User-specific services
|
# User-specific services
|
||||||
|
|||||||
Reference in New Issue
Block a user