documentation
This commit is contained in:
102
CLAUDE.md
102
CLAUDE.md
@@ -20,12 +20,23 @@ omnixy-rebuild # Convenience wrapper
|
||||
|
||||
# Update system and flake inputs
|
||||
omnixy update
|
||||
omnixy-update # Direct command
|
||||
|
||||
# Clean and optimize Nix store
|
||||
omnixy clean
|
||||
omnixy-clean # Direct command
|
||||
|
||||
# Search for packages
|
||||
omnixy search <package-name>
|
||||
omnixy-search <package-name> # Direct command
|
||||
|
||||
# Show system information
|
||||
omnixy info
|
||||
omnixy-info # Direct command
|
||||
|
||||
# Get help
|
||||
omnixy help
|
||||
omnixy-help # Direct command
|
||||
```
|
||||
|
||||
### Development Workflows
|
||||
@@ -39,6 +50,13 @@ nix develop .#python # Language-specific shell
|
||||
nix develop .#node # Node.js development
|
||||
nix develop .#rust # Rust development
|
||||
|
||||
# Alternative: Use omnixy development shells
|
||||
omnixy-dev-shell rust # Rust development shell
|
||||
omnixy-dev-shell python # Python development shell
|
||||
omnixy-dev-shell go # Go development shell
|
||||
omnixy-dev-shell js # JavaScript/Node.js shell
|
||||
omnixy-dev-shell c # C/C++ development shell
|
||||
|
||||
# Format Nix code
|
||||
nixpkgs-fmt *.nix
|
||||
alejandra *.nix # Alternative formatter
|
||||
@@ -53,12 +71,21 @@ deadnix . # Dead code elimination
|
||||
# Available themes in modules/themes/
|
||||
ls modules/themes/
|
||||
|
||||
# Test theme switch
|
||||
# List available themes
|
||||
omnixy theme
|
||||
omnixy-theme-list
|
||||
|
||||
# Switch theme
|
||||
omnixy theme tokyo-night
|
||||
omnixy-theme-set tokyo-night
|
||||
|
||||
# Available themes: tokyo-night, catppuccin, gruvbox, nord,
|
||||
# everforest, rose-pine, kanagawa, catppuccin-latte, matte-black,
|
||||
# osaka-jade, ristretto
|
||||
|
||||
# Create new theme
|
||||
cp modules/themes/tokyo-night.nix modules/themes/my-theme.nix
|
||||
# Edit color values and application configs
|
||||
# Edit color values and application configs, then rebuild
|
||||
```
|
||||
|
||||
## Architecture
|
||||
@@ -70,13 +97,22 @@ cp modules/themes/tokyo-night.nix modules/themes/my-theme.nix
|
||||
|
||||
### Module System
|
||||
The configuration is split into focused modules:
|
||||
- **modules/core.nix** - Base system settings and Omarchy options
|
||||
- **modules/core.nix** - Base system settings and OmniXY options
|
||||
- **modules/packages.nix** - Package collections with feature flags
|
||||
- **modules/development.nix** - Development tools and environments
|
||||
- **modules/desktop/hyprland.nix** - Hyprland compositor configuration
|
||||
- **modules/services.nix** - System services and daemons
|
||||
- **modules/users.nix** - User account management
|
||||
- **modules/themes/** - Theme-specific configurations
|
||||
- **modules/boot.nix** - Boot configuration and kernel parameters
|
||||
- **modules/security.nix** - Security settings and authentication
|
||||
- **modules/menus.nix** - Application menus and launchers
|
||||
- **modules/walker.nix** - Walker application launcher configuration
|
||||
- **modules/fastfetch.nix** - System information display
|
||||
- **modules/scripts.nix** - OmniXY utility scripts
|
||||
- **modules/themes/** - Complete theme system with multiple themes
|
||||
- **modules/hardware/** - Hardware-specific configurations (Intel, AMD, NVIDIA, Audio, etc.)
|
||||
- **modules/lib.nix** - Helper functions and utilities
|
||||
- **modules/colors.nix** - Color palette definitions
|
||||
- **modules/helpers.nix** - Additional helper functions
|
||||
|
||||
### Configuration Management
|
||||
1. **Declarative** - Everything defined in Nix expressions
|
||||
@@ -131,8 +167,9 @@ The configuration is split into focused modules:
|
||||
### Testing Changes
|
||||
- Build configuration: `nixos-rebuild build --flake .#omnixy`
|
||||
- Test in VM: `nixos-rebuild build-vm --flake .#omnixy`
|
||||
- Run VM: `./result/bin/run-omnixy-vm` or use the linked script in /nix/store
|
||||
- Check evaluation: `nix flake check`
|
||||
- Format code: `nixpkgs-fmt .`
|
||||
- Format code: `nixpkgs-fmt .` or `alejandra .`
|
||||
|
||||
### Home Manager Integration
|
||||
- User-specific configuration in home.nix
|
||||
@@ -154,8 +191,59 @@ The configuration is split into focused modules:
|
||||
3. Include necessary firmware and drivers
|
||||
4. Test on target hardware
|
||||
|
||||
### Installation and Bootstrap
|
||||
- Bootstrap script: `./boot.sh` - Downloads and runs installer on fresh NixOS
|
||||
- Interactive installer: `./install.sh` - Full styled installer with theme selection
|
||||
- Simple installer: `./install-simple.sh` - Unix-philosophy compliant, scriptable installer
|
||||
- Manual flake install: `sudo nixos-rebuild switch --flake github:TheArctesian/omnixy#omnixy`
|
||||
|
||||
### Unix Philosophy Tools (scripts/ directory)
|
||||
Focused, composable tools following "do one thing well":
|
||||
- `scripts/omnixy-check-system` - Just check system requirements
|
||||
- `scripts/omnixy-backup-config` - Just backup configuration
|
||||
- `scripts/omnixy-install-files` - Just copy files
|
||||
- `scripts/omnixy-configure-user` - Just update user configuration
|
||||
- `scripts/omnixy-build-system` - Just build/switch system
|
||||
|
||||
### Scriptable Usage Examples
|
||||
```bash
|
||||
# Quiet installation
|
||||
./install-simple.sh --quiet --user alice --theme gruvbox
|
||||
|
||||
# Test configuration without applying
|
||||
./install-simple.sh --dry-run
|
||||
|
||||
# Automated installation
|
||||
OMNIXY_USER=bob OMNIXY_THEME=nord ./install-simple.sh --quiet
|
||||
|
||||
# Use individual tools for custom workflows
|
||||
scripts/omnixy-check-system --nixos-only
|
||||
backup_path=$(scripts/omnixy-backup-config)
|
||||
scripts/omnixy-install-files
|
||||
scripts/omnixy-configure-user alice
|
||||
scripts/omnixy-build-system --dry-run
|
||||
|
||||
# Scriptable omnixy command with clean output
|
||||
omnixy --quiet theme set gruvbox
|
||||
omnixy --json info | jq .system.theme
|
||||
omnixy --quiet update && echo "Update complete"
|
||||
```
|
||||
|
||||
### Screenshots and Utilities
|
||||
- Take screenshots: `omnixy-screenshot` (region by default)
|
||||
- Screenshot modes: `omnixy-screenshot region|full|window`
|
||||
- Screenshots saved to `~/Pictures/Screenshots/` and copied to clipboard
|
||||
|
||||
### Development Containers
|
||||
The install.sh script mentions but doesn't implement:
|
||||
- `dev-postgres` - PostgreSQL container
|
||||
- `dev-redis` - Redis container
|
||||
- `dev-mysql` - MySQL container
|
||||
- `dev-mongodb` - MongoDB container
|
||||
|
||||
### Debugging Issues
|
||||
- Check system logs: `journalctl -xe`
|
||||
- Nix build logs: `nix log /nix/store/...`
|
||||
- Configuration evaluation: `nix show-config`
|
||||
- Module option documentation: `man configuration.nix`
|
||||
- Module option documentation: `man configuration.nix`
|
||||
- System information: `omnixy info` or `omnixy-info`
|
||||
169
DOCUMENTATION_INDEX.md
Normal file
169
DOCUMENTATION_INDEX.md
Normal file
@@ -0,0 +1,169 @@
|
||||
# OmniXY Documentation Index
|
||||
|
||||
This is the complete documentation system for the OmniXY NixOS operating system. Each directory and major component has been thoroughly documented to help users, developers, and contributors understand the system.
|
||||
|
||||
## 📁 Documentation Structure
|
||||
|
||||
### Main Documentation (`docs/`)
|
||||
- **[README.md](docs/README.md)** - Overview and getting started guide
|
||||
- **[ARCHITECTURE.md](docs/ARCHITECTURE.md)** - System architecture and design
|
||||
- **[INSTALLATION.md](docs/INSTALLATION.md)** - Complete installation guide
|
||||
- **[COMMANDS.md](docs/COMMANDS.md)** - Comprehensive command reference
|
||||
|
||||
### Repository Structure Documentation
|
||||
|
||||
#### Root Directory
|
||||
- **[ROOT_FILES.md](ROOT_FILES.md)** - Explains every file in the repository root
|
||||
|
||||
#### Core Directories
|
||||
- **[modules/README.md](modules/README.md)** - Module system architecture
|
||||
- **[scripts/README.md](scripts/README.md)** - Unix philosophy tools
|
||||
- **[packages/README.md](packages/README.md)** - Custom Nix packages
|
||||
|
||||
#### Specialized Modules
|
||||
- **[modules/themes/README.md](modules/themes/README.md)** - Theme system documentation
|
||||
- **[modules/hardware/README.md](modules/hardware/README.md)** - Hardware support modules
|
||||
- **[modules/desktop/README.md](modules/desktop/README.md)** - Desktop environment configuration
|
||||
|
||||
#### Development Resources
|
||||
- **[CLAUDE.md](CLAUDE.md)** - Claude Code AI assistant instructions
|
||||
|
||||
## 🎯 Quick Navigation
|
||||
|
||||
### For New Users
|
||||
1. Start with [docs/README.md](docs/README.md) for an overview
|
||||
2. Follow [docs/INSTALLATION.md](docs/INSTALLATION.md) to install
|
||||
3. Use [docs/COMMANDS.md](docs/COMMANDS.md) for daily operations
|
||||
|
||||
### For Developers
|
||||
1. Read [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for system design
|
||||
2. Check [modules/README.md](modules/README.md) for module development
|
||||
3. Review [CLAUDE.md](CLAUDE.md) for development workflows
|
||||
|
||||
### For System Administrators
|
||||
1. Review [docs/INSTALLATION.md](docs/INSTALLATION.md) for deployment
|
||||
2. Study [modules/hardware/README.md](modules/hardware/README.md) for hardware support
|
||||
3. Reference [docs/COMMANDS.md](docs/COMMANDS.md) for system management
|
||||
|
||||
## 📋 Documentation Coverage
|
||||
|
||||
### System Components
|
||||
- ✅ **Core System**: Fully documented architecture and components
|
||||
- ✅ **Module System**: Complete module development guide
|
||||
- ✅ **Theme System**: Comprehensive theming documentation
|
||||
- ✅ **Hardware Support**: Full hardware configuration coverage
|
||||
- ✅ **Desktop Environment**: Complete Hyprland setup documentation
|
||||
- ✅ **Unix Tools**: Detailed Unix philosophy implementation
|
||||
- ✅ **Package System**: Custom package development guide
|
||||
|
||||
### User Guides
|
||||
- ✅ **Installation**: Multiple installation methods covered
|
||||
- ✅ **Usage**: Daily operation commands and workflows
|
||||
- ✅ **Customization**: Theme and configuration customization
|
||||
- ✅ **Troubleshooting**: Common issues and solutions
|
||||
|
||||
### Developer Resources
|
||||
- ✅ **Architecture**: System design and component interaction
|
||||
- ✅ **Development**: Module and package development guides
|
||||
- ✅ **Testing**: Build and validation procedures
|
||||
- ✅ **Contributing**: Code style and contribution guidelines
|
||||
|
||||
## 🔍 Finding Information
|
||||
|
||||
### By Topic
|
||||
- **Installation**: [docs/INSTALLATION.md](docs/INSTALLATION.md)
|
||||
- **Commands**: [docs/COMMANDS.md](docs/COMMANDS.md)
|
||||
- **Themes**: [modules/themes/README.md](modules/themes/README.md)
|
||||
- **Hardware**: [modules/hardware/README.md](modules/hardware/README.md)
|
||||
- **Development**: [modules/README.md](modules/README.md)
|
||||
- **Architecture**: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)
|
||||
|
||||
### By User Type
|
||||
- **End Users**: docs/README.md → docs/INSTALLATION.md → docs/COMMANDS.md
|
||||
- **System Admins**: docs/INSTALLATION.md → modules/hardware/README.md → ROOT_FILES.md
|
||||
- **Developers**: docs/ARCHITECTURE.md → modules/README.md → CLAUDE.md
|
||||
- **Themers**: modules/themes/README.md → docs/COMMANDS.md
|
||||
- **Contributors**: All documentation (comprehensive understanding)
|
||||
|
||||
### By Directory
|
||||
```
|
||||
omnixy/
|
||||
├── docs/ # Main documentation
|
||||
│ ├── README.md # System overview
|
||||
│ ├── ARCHITECTURE.md # Technical architecture
|
||||
│ ├── INSTALLATION.md # Installation guide
|
||||
│ └── COMMANDS.md # Command reference
|
||||
├── ROOT_FILES.md # Root directory documentation
|
||||
├── CLAUDE.md # AI assistant instructions
|
||||
├── modules/
|
||||
│ ├── README.md # Module system guide
|
||||
│ ├── themes/README.md # Theme system documentation
|
||||
│ ├── hardware/README.md # Hardware support guide
|
||||
│ └── desktop/README.md # Desktop environment docs
|
||||
├── scripts/README.md # Unix philosophy tools
|
||||
└── packages/README.md # Custom package system
|
||||
```
|
||||
|
||||
## 📖 Reading Order Recommendations
|
||||
|
||||
### First-Time Installation
|
||||
1. [docs/README.md](docs/README.md) - System overview
|
||||
2. [docs/INSTALLATION.md](docs/INSTALLATION.md) - Installation process
|
||||
3. [docs/COMMANDS.md](docs/COMMANDS.md) - Basic usage
|
||||
|
||||
### Customization Journey
|
||||
1. [modules/themes/README.md](modules/themes/README.md) - Theme selection
|
||||
2. [modules/README.md](modules/README.md) - Understanding modules
|
||||
3. [ROOT_FILES.md](ROOT_FILES.md) - Configuration files
|
||||
|
||||
### Development Path
|
||||
1. [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) - System design
|
||||
2. [modules/README.md](modules/README.md) - Module development
|
||||
3. [packages/README.md](packages/README.md) - Package creation
|
||||
4. [CLAUDE.md](CLAUDE.md) - Development workflows
|
||||
|
||||
### Administration Route
|
||||
1. [docs/INSTALLATION.md](docs/INSTALLATION.md) - Deployment
|
||||
2. [modules/hardware/README.md](modules/hardware/README.md) - Hardware config
|
||||
3. [scripts/README.md](scripts/README.md) - Management tools
|
||||
4. [docs/COMMANDS.md](docs/COMMANDS.md) - Operation reference
|
||||
|
||||
## 🛠️ Maintenance and Updates
|
||||
|
||||
### Documentation Standards
|
||||
- Each directory has a README.md explaining its contents
|
||||
- All major files are documented with purpose and usage
|
||||
- Code examples are provided where relevant
|
||||
- Troubleshooting sections included where needed
|
||||
|
||||
### Keeping Documentation Current
|
||||
- Update docs when adding new features
|
||||
- Verify examples and commands work correctly
|
||||
- Update version-specific information
|
||||
- Review and update external links
|
||||
|
||||
### Contributing to Documentation
|
||||
- Follow the existing documentation structure
|
||||
- Use clear, concise language
|
||||
- Include practical examples
|
||||
- Test all provided commands and procedures
|
||||
|
||||
## 🎓 Learning Resources
|
||||
|
||||
### External Documentation
|
||||
- [NixOS Manual](https://nixos.org/manual/nixos/stable/)
|
||||
- [Home Manager Manual](https://nix-community.github.io/home-manager/)
|
||||
- [Hyprland Wiki](https://wiki.hyprland.org/)
|
||||
- [Nix Package Search](https://search.nixos.org/)
|
||||
|
||||
### Community Resources
|
||||
- [GitHub Issues](https://github.com/TheArctesian/omnixy/issues)
|
||||
- [GitHub Discussions](https://github.com/TheArctesian/omnixy/discussions)
|
||||
- [NixOS Discourse](https://discourse.nixos.org/)
|
||||
|
||||
### Development Learning
|
||||
- [Nix Pills](https://nixos.org/guides/nix-pills/)
|
||||
- [NixOS & Flakes Book](https://nixos-and-flakes.thiscute.world/)
|
||||
- [Zero to Nix](https://zero-to-nix.com/)
|
||||
|
||||
This documentation system provides comprehensive coverage of all aspects of OmniXY, making it accessible to users of all skill levels while providing the depth needed for development and customization.
|
||||
191
ROOT_FILES.md
Normal file
191
ROOT_FILES.md
Normal file
@@ -0,0 +1,191 @@
|
||||
# Root Directory Files
|
||||
|
||||
This document explains the purpose of each file in the root directory of the OmniXY repository.
|
||||
|
||||
## Configuration Files
|
||||
|
||||
### `flake.nix`
|
||||
**Purpose**: Main Nix flake definition
|
||||
- Defines all external dependencies (inputs)
|
||||
- Exports system configurations, packages, and development shells
|
||||
- Contains the core logic for building OmniXY
|
||||
- Manages reproducible builds through flake.lock
|
||||
|
||||
**Key Sections**:
|
||||
- `inputs`: External dependencies (nixpkgs, home-manager, hyprland, etc.)
|
||||
- `outputs`: NixOS configuration, packages, development shells, apps
|
||||
- `nixosConfigurations.omnixy`: Main system configuration
|
||||
- `devShells`: Language-specific development environments
|
||||
- `packages`: Custom OmniXY utilities and tools
|
||||
- `apps`: Executable applications (installer)
|
||||
|
||||
### `configuration.nix`
|
||||
**Purpose**: Main NixOS system configuration entry point
|
||||
- Imports all system modules
|
||||
- Defines the current theme selection
|
||||
- Sets system-wide options and services
|
||||
- Configures hardware-specific settings
|
||||
|
||||
**What it does**:
|
||||
- Enables essential system services
|
||||
- Imports modular configurations from `modules/`
|
||||
- Sets the active theme (controls entire system appearance)
|
||||
- Defines system users and permissions
|
||||
- Configures boot settings and hardware
|
||||
|
||||
### `home.nix`
|
||||
**Purpose**: Home Manager configuration for user environment
|
||||
- Manages user-specific packages and settings
|
||||
- Configures dotfiles and application preferences
|
||||
- Handles user services and desktop environment
|
||||
- Integrates with the theme system
|
||||
|
||||
**What it manages**:
|
||||
- User package installations
|
||||
- Shell configuration (zsh, bash)
|
||||
- Git configuration and tools
|
||||
- Development environment settings
|
||||
- Application configurations that run as user
|
||||
|
||||
### `flake.lock`
|
||||
**Purpose**: Lock file for reproducible builds
|
||||
- Pins exact versions of all dependencies
|
||||
- Ensures identical builds across different machines
|
||||
- Generated automatically by Nix
|
||||
- Should be committed to version control
|
||||
|
||||
### `hardware-configuration.nix`
|
||||
**Purpose**: Hardware-specific NixOS configuration
|
||||
- Generated by `nixos-generate-config`
|
||||
- Contains machine-specific settings
|
||||
- Defines boot loader, filesystems, and kernel modules
|
||||
- Should be customized per installation
|
||||
|
||||
**Generated content**:
|
||||
- Filesystem mount points
|
||||
- Boot loader configuration
|
||||
- Hardware-specific kernel modules
|
||||
- Network interface settings
|
||||
|
||||
## Installation Files
|
||||
|
||||
### `install.sh`
|
||||
**Purpose**: Interactive, styled installer script
|
||||
- Beautiful terminal UI with colors and animations
|
||||
- Guides users through complete installation process
|
||||
- Handles system verification, backup, and configuration
|
||||
- Includes theme selection and feature configuration
|
||||
|
||||
**Features**:
|
||||
- System requirements checking
|
||||
- Automatic configuration backup
|
||||
- User account setup
|
||||
- Theme selection interface
|
||||
- Feature toggles (fingerprint, gaming, etc.)
|
||||
- System building with progress indication
|
||||
|
||||
### `install-simple.sh`
|
||||
**Purpose**: Unix philosophy compliant installer
|
||||
- Command-line arguments instead of interactive prompts
|
||||
- Scriptable and automatable
|
||||
- Clean, pipeable output
|
||||
- Follows "do one thing well" principle
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
./install-simple.sh --user alice --theme gruvbox --quiet
|
||||
```
|
||||
|
||||
**Options**:
|
||||
- `--user`: Set username
|
||||
- `--theme`: Select theme
|
||||
- `--quiet`: Minimal output
|
||||
- `--dry-run`: Test without applying changes
|
||||
|
||||
### `boot.sh`
|
||||
**Purpose**: Bootstrap script for fresh NixOS installations
|
||||
- Downloads OmniXY from GitHub
|
||||
- Minimal dependencies (just bash and basic tools)
|
||||
- Runs the full installer automatically
|
||||
- Can be executed via curl pipe
|
||||
|
||||
**What it does**:
|
||||
1. Verifies NixOS installation
|
||||
2. Installs git if needed
|
||||
3. Clones the OmniXY repository
|
||||
4. Executes the main installer
|
||||
|
||||
## Documentation Files
|
||||
|
||||
### `README.md`
|
||||
**Purpose**: Main project documentation and introduction
|
||||
- Project overview and features
|
||||
- Installation instructions
|
||||
- Usage examples and configuration
|
||||
- Contributing guidelines and links
|
||||
|
||||
### `CLAUDE.md`
|
||||
**Purpose**: Instructions for Claude Code AI assistant
|
||||
- Development workflow documentation
|
||||
- Command references and examples
|
||||
- Architecture explanations
|
||||
- Best practices and conventions
|
||||
|
||||
### `LICENSE`
|
||||
**Purpose**: Legal license for the project
|
||||
- Defines usage rights and restrictions
|
||||
- Currently MIT License
|
||||
- Applies to all code in the repository
|
||||
|
||||
## Asset Files
|
||||
|
||||
### `logo.svg` / `logo.txt`
|
||||
**Purpose**: OmniXY project logos
|
||||
- SVG vector logo for web/documentation
|
||||
- ASCII art logo for terminal display
|
||||
- Used in installers and documentation
|
||||
|
||||
### `icon.png` / `icon.txt`
|
||||
**Purpose**: Project icons
|
||||
- PNG icon for applications and desktop
|
||||
- ASCII icon for terminal contexts
|
||||
|
||||
## Development Files
|
||||
|
||||
### `*.qcow2` files (if present)
|
||||
**Purpose**: Virtual machine disk images
|
||||
- Pre-built OmniXY system images for testing
|
||||
- Used for development and demonstration
|
||||
- Can be run with QEMU/KVM
|
||||
|
||||
## File Organization Principles
|
||||
|
||||
1. **Configuration First**: Core system files at root level
|
||||
2. **Clear Naming**: Descriptive filenames indicate purpose
|
||||
3. **Separation of Concerns**: Different aspects in separate files
|
||||
4. **Documentation**: Every major file documented
|
||||
5. **Reproducibility**: All build inputs tracked and versioned
|
||||
|
||||
## Relationship Between Files
|
||||
|
||||
```
|
||||
flake.nix
|
||||
↓ (imports)
|
||||
configuration.nix
|
||||
↓ (imports)
|
||||
modules/*.nix
|
||||
↓ (configures)
|
||||
System Services & Packages
|
||||
|
||||
home.nix
|
||||
↓ (configures)
|
||||
User Environment & Dotfiles
|
||||
|
||||
install.sh / install-simple.sh
|
||||
↓ (copies and configures)
|
||||
All Configuration Files
|
||||
↓ (builds)
|
||||
Complete OmniXY System
|
||||
```
|
||||
|
||||
This structure provides a clear separation between system configuration, user environment, installation tooling, and documentation, making the project maintainable and understandable.
|
||||
@@ -109,7 +109,7 @@ in
|
||||
};
|
||||
|
||||
# Sound (deprecated option removed)
|
||||
hardware.pulseaudio.enable = false;
|
||||
services.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
|
||||
216
docs/ARCHITECTURE.md
Normal file
216
docs/ARCHITECTURE.md
Normal file
@@ -0,0 +1,216 @@
|
||||
# OmniXY Architecture
|
||||
|
||||
## Overview
|
||||
OmniXY is built on a layered architecture that combines NixOS's declarative system configuration with modern desktop tools and development environments.
|
||||
|
||||
## System Layers
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────┐
|
||||
│ User Interface │
|
||||
│ Hyprland + Waybar + Applications │
|
||||
├─────────────────────────────────────────┤
|
||||
│ Desktop Environment │
|
||||
│ Theme System + Window Management │
|
||||
├─────────────────────────────────────────┤
|
||||
│ OmniXY Configuration │
|
||||
│ Modules + Scripts + Packages │
|
||||
├─────────────────────────────────────────┤
|
||||
│ Home Manager Layer │
|
||||
│ User Environment & Dotfiles │
|
||||
├─────────────────────────────────────────┤
|
||||
│ NixOS System │
|
||||
│ Package Management + Services │
|
||||
├─────────────────────────────────────────┤
|
||||
│ Linux Kernel │
|
||||
│ Hardware Abstraction │
|
||||
└─────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## Core Components
|
||||
|
||||
### 1. Nix Flake System (`flake.nix`)
|
||||
The foundation that defines all system inputs and outputs:
|
||||
- **Inputs**: External dependencies (nixpkgs, home-manager, hyprland)
|
||||
- **Outputs**: System configurations, packages, development shells, apps
|
||||
- **Lock File**: Ensures reproducible builds across machines
|
||||
|
||||
### 2. System Configuration (`configuration.nix`)
|
||||
Main NixOS system configuration that:
|
||||
- Imports all modules
|
||||
- Defines system-wide settings
|
||||
- Sets the current theme
|
||||
- Configures hardware and services
|
||||
|
||||
### 3. Module System (`modules/`)
|
||||
Modular architecture with focused components:
|
||||
- **Core**: Base system settings and OmniXY options
|
||||
- **Themes**: Complete color schemes and application theming
|
||||
- **Hardware**: Device-specific configurations
|
||||
- **Desktop**: Window manager and GUI settings
|
||||
- **Development**: Programming tools and environments
|
||||
|
||||
### 4. Home Manager (`home.nix`)
|
||||
User environment management:
|
||||
- User-specific packages
|
||||
- Dotfile configuration
|
||||
- Application settings
|
||||
- Theme integration
|
||||
|
||||
### 5. Package System (`packages/`)
|
||||
Custom Nix packages:
|
||||
- OmniXY utility scripts
|
||||
- Specialized tools
|
||||
- Theme packages
|
||||
|
||||
### 6. Unix Tools (`scripts/`)
|
||||
Focused utilities following Unix philosophy:
|
||||
- System management
|
||||
- Configuration backup
|
||||
- User setup
|
||||
- Build automation
|
||||
|
||||
## Data Flow
|
||||
|
||||
### System Build Process
|
||||
```
|
||||
flake.nix → configuration.nix → modules/*.nix → system build
|
||||
↓ ↓ ↓
|
||||
inputs system opts module config
|
||||
↓ ↓ ↓
|
||||
nixpkgs theme selection packages/services
|
||||
```
|
||||
|
||||
### Theme Application Flow
|
||||
```
|
||||
Theme Selection → Module Configuration → Application Settings
|
||||
↓ ↓ ↓
|
||||
omnixy theme modules/themes/ GTK/Qt/Terminal
|
||||
set <name> <name>.nix theming
|
||||
```
|
||||
|
||||
### User Environment Flow
|
||||
```
|
||||
home.nix → Home Manager → User Packages & Dotfiles
|
||||
↓ ↓ ↓
|
||||
user config evaluation ~/.config/* files
|
||||
```
|
||||
|
||||
## Configuration Management
|
||||
|
||||
### Declarative Configuration
|
||||
- All system state defined in Nix expressions
|
||||
- No imperative commands modify system configuration
|
||||
- Changes require rebuild to take effect
|
||||
|
||||
### Immutable System
|
||||
- Built configurations are immutable
|
||||
- Previous generations available for rollback
|
||||
- Atomic upgrades prevent partial failures
|
||||
|
||||
### Module Composition
|
||||
- Features implemented as independent modules
|
||||
- Modules can depend on other modules
|
||||
- Options system provides configuration interface
|
||||
|
||||
### Reproducible Builds
|
||||
- Flake inputs pinned with lock file
|
||||
- Same inputs produce identical outputs
|
||||
- Cross-machine consistency guaranteed
|
||||
|
||||
## Development Architecture
|
||||
|
||||
### Language Support
|
||||
Each language environment includes:
|
||||
- Runtime and tools
|
||||
- Language server protocols (LSPs)
|
||||
- Package managers
|
||||
- Development utilities
|
||||
|
||||
### Shell Environments
|
||||
```
|
||||
Development Shell:
|
||||
nix develop .#<language>
|
||||
↓
|
||||
Language-specific packages
|
||||
↓
|
||||
Configured environment
|
||||
```
|
||||
|
||||
### Tool Integration
|
||||
- Git with lazygit TUI
|
||||
- Terminal with shell integration
|
||||
- Editor with language support
|
||||
- Build systems and debuggers
|
||||
|
||||
## Theme Architecture
|
||||
|
||||
### Unified Theming
|
||||
All applications themed consistently:
|
||||
- Terminal emulators (Alacritty, Kitty)
|
||||
- Text editors (Neovim, VSCode)
|
||||
- Desktop components (Waybar, Hyprland)
|
||||
- GUI applications (GTK, Qt)
|
||||
|
||||
### Color Management
|
||||
```
|
||||
Theme Module → Color Variables → Application Configs
|
||||
↓ ↓ ↓
|
||||
tokyo-night.nix → #7aa2f7 (blue) → terminal.colors.blue
|
||||
```
|
||||
|
||||
### Theme Switching
|
||||
1. Update configuration.nix with new theme
|
||||
2. Rebuild system to apply changes
|
||||
3. All applications automatically use new theme
|
||||
|
||||
## Hardware Support
|
||||
|
||||
### Adaptive Configuration
|
||||
- Automatic hardware detection
|
||||
- GPU-specific optimizations (Intel, AMD, NVIDIA)
|
||||
- Audio system configuration
|
||||
- Network and Bluetooth setup
|
||||
|
||||
### Conditional Modules
|
||||
```nix
|
||||
config = lib.mkIf cfg.hardware.nvidia.enable {
|
||||
# NVIDIA-specific configuration
|
||||
};
|
||||
```
|
||||
|
||||
## Security Architecture
|
||||
|
||||
### System Security
|
||||
- Secure boot support
|
||||
- Firewall configuration
|
||||
- AppArmor profiles
|
||||
- User isolation
|
||||
|
||||
### Authentication
|
||||
- Multi-factor authentication support
|
||||
- Fingerprint integration
|
||||
- FIDO2 security keys
|
||||
- Password management
|
||||
|
||||
## Extensibility
|
||||
|
||||
### Custom Modules
|
||||
- Follow NixOS module structure
|
||||
- Use options for configuration
|
||||
- Implement proper dependencies
|
||||
- Document all options
|
||||
|
||||
### Package Development
|
||||
- Custom packages in `packages/`
|
||||
- Integration with flake outputs
|
||||
- Proper meta information
|
||||
- Cross-platform support
|
||||
|
||||
### Theme Development
|
||||
- Color palette definition
|
||||
- Application configuration
|
||||
- Testing across components
|
||||
- Documentation and examples
|
||||
|
||||
This architecture provides a solid foundation for a reproducible, customizable, and maintainable desktop Linux system.
|
||||
374
docs/COMMANDS.md
Normal file
374
docs/COMMANDS.md
Normal file
@@ -0,0 +1,374 @@
|
||||
# OmniXY Command Reference
|
||||
|
||||
This document provides a comprehensive reference for all OmniXY commands and utilities.
|
||||
|
||||
## Main Command Interface
|
||||
|
||||
### `omnixy`
|
||||
The primary command interface supporting global flags and subcommands.
|
||||
|
||||
**Global Flags**:
|
||||
- `--quiet`, `-q`: Minimal output for scripting
|
||||
- `--json`: Machine-readable JSON output where applicable
|
||||
|
||||
**Subcommands**:
|
||||
- `help`: Show comprehensive help
|
||||
- `info`, `status`: Display system information
|
||||
- `update`, `upgrade`: Update system and flake inputs
|
||||
- `clean`, `gc`: Garbage collection and optimization
|
||||
- `theme`: Theme management
|
||||
- `search`: Package search
|
||||
- `install`: Package installation guide
|
||||
|
||||
## System Management Commands
|
||||
|
||||
### System Information
|
||||
```bash
|
||||
# System overview
|
||||
omnixy info
|
||||
|
||||
# Quiet output (key=value pairs)
|
||||
omnixy --quiet info
|
||||
|
||||
# JSON output for scripting
|
||||
omnixy --json info | jq .system.version
|
||||
```
|
||||
|
||||
### System Updates
|
||||
```bash
|
||||
# Update system with progress indication
|
||||
omnixy update
|
||||
|
||||
# Quiet update for scripts
|
||||
omnixy --quiet update
|
||||
|
||||
# Manual rebuild
|
||||
omnixy-rebuild
|
||||
```
|
||||
|
||||
### System Maintenance
|
||||
```bash
|
||||
# Clean and optimize
|
||||
omnixy clean
|
||||
|
||||
# Show current/new store sizes
|
||||
omnixy clean # Shows before/after sizes
|
||||
|
||||
# Quiet cleanup
|
||||
omnixy --quiet clean
|
||||
```
|
||||
|
||||
## Theme Management Commands
|
||||
|
||||
### Theme Operations
|
||||
```bash
|
||||
# List all available themes
|
||||
omnixy theme list
|
||||
omnixy theme ls
|
||||
|
||||
# Get current theme
|
||||
omnixy theme get
|
||||
omnixy theme current
|
||||
|
||||
# Set new theme
|
||||
omnixy theme set tokyo-night
|
||||
omnixy theme kanagawa
|
||||
```
|
||||
|
||||
### Scriptable Theme Management
|
||||
```bash
|
||||
# List themes (one per line)
|
||||
omnixy --quiet theme list
|
||||
|
||||
# JSON theme information
|
||||
omnixy --json theme list
|
||||
|
||||
# Current theme for scripting
|
||||
current_theme=$(omnixy --quiet theme get)
|
||||
|
||||
# Automated theme cycling
|
||||
themes=($(omnixy --quiet theme list))
|
||||
next_theme=${themes[$(( ($(omnixy --quiet theme list | grep -n "$(omnixy --quiet theme get)" | cut -d: -f1) % ${#themes[@]}) ))]}
|
||||
omnixy theme set "$next_theme"
|
||||
```
|
||||
|
||||
## Package Management Commands
|
||||
|
||||
### Package Search
|
||||
```bash
|
||||
# Search for packages
|
||||
omnixy search firefox
|
||||
omnixy search development-tools
|
||||
|
||||
# Direct nix search
|
||||
nix search nixpkgs firefox
|
||||
```
|
||||
|
||||
### Package Installation
|
||||
```bash
|
||||
# Installation guide (interactive)
|
||||
omnixy install firefox
|
||||
|
||||
# Note: Actual installation requires editing configuration files
|
||||
# and rebuilding the system
|
||||
```
|
||||
|
||||
## Development Commands
|
||||
|
||||
### Development Shells
|
||||
```bash
|
||||
# Language-specific development environments
|
||||
omnixy-dev-shell rust # Rust toolchain
|
||||
omnixy-dev-shell python # Python environment
|
||||
omnixy-dev-shell go # Go development
|
||||
omnixy-dev-shell js # Node.js/JavaScript
|
||||
omnixy-dev-shell node # Alternative for Node.js
|
||||
omnixy-dev-shell c # C/C++ development
|
||||
omnixy-dev-shell cpp # Alternative for C++
|
||||
|
||||
# Using flake development shells
|
||||
nix develop # Default development shell
|
||||
nix develop .#rust # Rust-specific shell
|
||||
nix develop .#python # Python-specific shell
|
||||
nix develop .#node # Node.js-specific shell
|
||||
```
|
||||
|
||||
## Utility Commands
|
||||
|
||||
### Screenshot Management
|
||||
```bash
|
||||
# Interactive region selection (default)
|
||||
omnixy-screenshot
|
||||
omnixy-screenshot region
|
||||
|
||||
# Full screen capture
|
||||
omnixy-screenshot full
|
||||
omnixy-screenshot screen
|
||||
|
||||
# Active window capture
|
||||
omnixy-screenshot window
|
||||
```
|
||||
|
||||
### System Help
|
||||
```bash
|
||||
# Comprehensive help system
|
||||
omnixy help
|
||||
omnixy-help
|
||||
|
||||
# Command-specific help
|
||||
omnixy --help
|
||||
omnixy theme --help
|
||||
```
|
||||
|
||||
## Unix Philosophy Tools
|
||||
|
||||
Located in `scripts/` directory - focused utilities following Unix principles:
|
||||
|
||||
### System Validation
|
||||
```bash
|
||||
# Complete system check
|
||||
./scripts/omnixy-check-system
|
||||
|
||||
# Check only NixOS
|
||||
./scripts/omnixy-check-system --nixos-only
|
||||
|
||||
# Check permissions only
|
||||
./scripts/omnixy-check-system --permissions-only
|
||||
|
||||
# Silent check (exit codes only)
|
||||
./scripts/omnixy-check-system --quiet
|
||||
|
||||
# JSON output
|
||||
OMNIXY_JSON=1 ./scripts/omnixy-check-system
|
||||
```
|
||||
|
||||
### Configuration Management
|
||||
```bash
|
||||
# Create configuration backup
|
||||
backup_path=$(./scripts/omnixy-backup-config)
|
||||
echo "Backup created at: $backup_path"
|
||||
|
||||
# Custom backup location
|
||||
./scripts/omnixy-backup-config /custom/backup/path
|
||||
|
||||
# Install configuration files
|
||||
./scripts/omnixy-install-files
|
||||
|
||||
# Custom source/destination
|
||||
./scripts/omnixy-install-files /source/path /dest/path
|
||||
```
|
||||
|
||||
### User Configuration
|
||||
```bash
|
||||
# Interactive user setup
|
||||
username=$(./scripts/omnixy-configure-user)
|
||||
|
||||
# Non-interactive mode
|
||||
./scripts/omnixy-configure-user alice
|
||||
|
||||
# Custom config files
|
||||
./scripts/omnixy-configure-user alice /etc/nixos/configuration.nix /etc/nixos/home.nix
|
||||
```
|
||||
|
||||
### System Building
|
||||
```bash
|
||||
# Build and switch system
|
||||
./scripts/omnixy-build-system
|
||||
|
||||
# Dry run (test only)
|
||||
./scripts/omnixy-build-system --dry-run
|
||||
|
||||
# Custom configuration
|
||||
./scripts/omnixy-build-system /path/to/config custom-name
|
||||
```
|
||||
|
||||
## Installation Commands
|
||||
|
||||
### Simple Installer
|
||||
```bash
|
||||
# Basic installation
|
||||
./install-simple.sh
|
||||
|
||||
# With options
|
||||
./install-simple.sh --user alice --theme gruvbox --quiet
|
||||
|
||||
# Dry run
|
||||
./install-simple.sh --dry-run
|
||||
|
||||
# Environment variables
|
||||
OMNIXY_USER=bob OMNIXY_THEME=nord ./install-simple.sh --quiet
|
||||
```
|
||||
|
||||
### Interactive Installer
|
||||
```bash
|
||||
# Full interactive experience
|
||||
./install.sh
|
||||
|
||||
# Features styled terminal interface with:
|
||||
# - System verification
|
||||
# - User configuration
|
||||
# - Theme selection
|
||||
# - Feature toggles
|
||||
# - Progress indication
|
||||
```
|
||||
|
||||
### Bootstrap Installation
|
||||
```bash
|
||||
# Remote bootstrap (run on fresh NixOS)
|
||||
curl -fsSL https://raw.githubusercontent.com/thearctesian/omnixy/main/boot.sh | bash
|
||||
|
||||
# Local bootstrap
|
||||
./boot.sh
|
||||
```
|
||||
|
||||
## Advanced Commands
|
||||
|
||||
### Build System Commands
|
||||
```bash
|
||||
# Build without switching
|
||||
nixos-rebuild build --flake .#omnixy
|
||||
|
||||
# Build VM for testing
|
||||
nixos-rebuild build-vm --flake .#omnixy
|
||||
|
||||
# Run VM
|
||||
./result/bin/run-omnixy-vm
|
||||
|
||||
# Check flake evaluation
|
||||
nix flake check
|
||||
|
||||
# Update flake inputs
|
||||
nix flake update
|
||||
```
|
||||
|
||||
### Package Building
|
||||
```bash
|
||||
# Build OmniXY scripts package
|
||||
nix build .#omnixy-scripts
|
||||
|
||||
# Test built scripts
|
||||
./result/bin/omnixy --help
|
||||
|
||||
# Build specific packages
|
||||
nix build .#package-name
|
||||
```
|
||||
|
||||
### Development Commands
|
||||
```bash
|
||||
# Format Nix code
|
||||
nixpkgs-fmt *.nix **/*.nix
|
||||
alejandra *.nix # Alternative formatter
|
||||
|
||||
# Nix code analysis
|
||||
statix check . # Static analysis
|
||||
deadnix . # Dead code detection
|
||||
|
||||
# Show flake info
|
||||
nix flake show
|
||||
nix flake metadata
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
### Global Settings
|
||||
- `OMNIXY_QUIET=1`: Enable quiet mode for all commands
|
||||
- `OMNIXY_JSON=1`: Enable JSON output where supported
|
||||
- `OMNIXY_USER`: Default username for installation
|
||||
- `OMNIXY_THEME`: Default theme for installation
|
||||
|
||||
### Usage Examples
|
||||
```bash
|
||||
# Quiet automation
|
||||
export OMNIXY_QUIET=1
|
||||
omnixy update && omnixy clean && echo "Maintenance complete"
|
||||
|
||||
# JSON processing
|
||||
omnixy --json info | jq -r '.system.version'
|
||||
|
||||
# Environment-based installation
|
||||
export OMNIXY_USER=developer
|
||||
export OMNIXY_THEME=tokyo-night
|
||||
./install-simple.sh --quiet
|
||||
```
|
||||
|
||||
## Command Composition Examples
|
||||
|
||||
### System Maintenance Script
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# Complete system maintenance
|
||||
|
||||
echo "Starting system maintenance..."
|
||||
|
||||
# Update system
|
||||
omnixy --quiet update || { echo "Update failed"; exit 1; }
|
||||
|
||||
# Clean system
|
||||
omnixy --quiet clean
|
||||
|
||||
# Verify system health
|
||||
omnixy --quiet info | grep -q "NixOS" || { echo "System check failed"; exit 1; }
|
||||
|
||||
echo "Maintenance complete"
|
||||
```
|
||||
|
||||
### Theme Rotation Script
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# Rotate through available themes
|
||||
|
||||
current=$(omnixy --quiet theme get)
|
||||
themes=($(omnixy --quiet theme list))
|
||||
|
||||
for i in "${!themes[@]}"; do
|
||||
if [[ "${themes[$i]}" == "$current" ]]; then
|
||||
next_index=$(( (i + 1) % ${#themes[@]} ))
|
||||
next_theme="${themes[$next_index]}"
|
||||
omnixy theme set "$next_theme"
|
||||
echo "Switched from $current to $next_theme"
|
||||
break
|
||||
fi
|
||||
done
|
||||
```
|
||||
|
||||
This command reference provides comprehensive coverage of all OmniXY utilities, making it easy to find and use the right tool for any task.
|
||||
441
docs/INSTALLATION.md
Normal file
441
docs/INSTALLATION.md
Normal file
@@ -0,0 +1,441 @@
|
||||
# OmniXY Installation Guide
|
||||
|
||||
This guide covers all methods of installing OmniXY on your NixOS system, from automated installation to manual configuration.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### System Requirements
|
||||
- **Operating System**: NixOS 24.05 or newer
|
||||
- **RAM**: 8GB minimum (16GB+ recommended for development)
|
||||
- **Storage**: 40GB free space (for Nix store and applications)
|
||||
- **Boot**: UEFI system (for systemd-boot configuration)
|
||||
- **Network**: Stable internet connection for package downloads
|
||||
|
||||
### Pre-Installation Checklist
|
||||
```bash
|
||||
# Verify NixOS installation
|
||||
cat /etc/NIXOS
|
||||
|
||||
# Check available space
|
||||
df -h /
|
||||
|
||||
# Verify internet connectivity
|
||||
ping -c 3 github.com
|
||||
|
||||
# Check user permissions
|
||||
groups $USER | grep -q wheel && echo "User has sudo access"
|
||||
```
|
||||
|
||||
## Installation Methods
|
||||
|
||||
### Method 1: Bootstrap Installation (Recommended)
|
||||
|
||||
The fastest way to install OmniXY on a fresh NixOS system:
|
||||
|
||||
```bash
|
||||
# Download and run bootstrap installer
|
||||
curl -fsSL https://raw.githubusercontent.com/thearctesian/omnixy/main/boot.sh | bash
|
||||
```
|
||||
|
||||
**What this does**:
|
||||
1. Verifies NixOS installation
|
||||
2. Downloads OmniXY repository
|
||||
3. Runs the interactive installer
|
||||
4. Guides you through configuration
|
||||
|
||||
**Advantages**:
|
||||
- Single command installation
|
||||
- Always uses latest version
|
||||
- No local repository needed
|
||||
- Automatic dependency handling
|
||||
|
||||
### Method 2: Interactive Installation
|
||||
|
||||
For users who want control over the installation process:
|
||||
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone https://github.com/thearctesian/omnixy
|
||||
cd omnixy
|
||||
|
||||
# Run interactive installer
|
||||
./install.sh
|
||||
```
|
||||
|
||||
**Features**:
|
||||
- Beautiful terminal interface with Tokyo Night colors
|
||||
- Step-by-step guidance
|
||||
- Theme selection with previews
|
||||
- Optional features configuration
|
||||
- Progress indication
|
||||
- Automatic backup creation
|
||||
|
||||
**Installation Steps**:
|
||||
1. **System Verification**: Checks NixOS and permissions
|
||||
2. **Configuration Backup**: Saves existing `/etc/nixos`
|
||||
3. **File Installation**: Copies OmniXY configuration
|
||||
4. **User Setup**: Configure username and home directory
|
||||
5. **Theme Selection**: Choose from 11 available themes
|
||||
6. **Feature Configuration**: Enable optional features
|
||||
7. **System Build**: Build and switch to new configuration
|
||||
|
||||
### Method 3: Simple Installation (Unix Philosophy)
|
||||
|
||||
For automation and scripting:
|
||||
|
||||
```bash
|
||||
# Clone repository
|
||||
git clone https://github.com/thearctesian/omnixy
|
||||
cd omnixy
|
||||
|
||||
# Run simple installer with options
|
||||
./install-simple.sh --user alice --theme gruvbox --quiet
|
||||
```
|
||||
|
||||
**Command Options**:
|
||||
- `--user USERNAME`: Set username (default: prompt)
|
||||
- `--theme THEME`: Select theme (default: tokyo-night)
|
||||
- `--quiet`, `-q`: Minimal output
|
||||
- `--dry-run`, `-n`: Test without applying changes
|
||||
- `--help`, `-h`: Show help
|
||||
|
||||
**Environment Variables**:
|
||||
- `OMNIXY_USER`: Default username
|
||||
- `OMNIXY_THEME`: Default theme
|
||||
- `OMNIXY_QUIET=1`: Enable quiet mode
|
||||
|
||||
**Examples**:
|
||||
```bash
|
||||
# Fully automated installation
|
||||
OMNIXY_USER=developer OMNIXY_THEME=tokyo-night ./install-simple.sh --quiet
|
||||
|
||||
# Test installation without applying
|
||||
./install-simple.sh --user testuser --dry-run
|
||||
|
||||
# Interactive theme selection
|
||||
./install-simple.sh --user alice
|
||||
```
|
||||
|
||||
### Method 4: Manual Flake Installation
|
||||
|
||||
For advanced users who want direct control:
|
||||
|
||||
```bash
|
||||
# Direct flake installation (replaces entire system)
|
||||
sudo nixos-rebuild switch --flake github:thearctesian/omnixy#omnixy
|
||||
|
||||
# Or with local repository
|
||||
git clone https://github.com/thearctesian/omnixy
|
||||
cd omnixy
|
||||
sudo nixos-rebuild switch --flake .#omnixy
|
||||
```
|
||||
|
||||
**Important Notes**:
|
||||
- Requires manual user configuration editing
|
||||
- No automatic backup
|
||||
- Assumes advanced Nix knowledge
|
||||
- May overwrite existing configuration
|
||||
|
||||
## Step-by-Step Installation Process
|
||||
|
||||
### 1. Pre-Installation Setup
|
||||
|
||||
```bash
|
||||
# Update NixOS channel (optional)
|
||||
sudo nix-channel --update
|
||||
|
||||
# Ensure git is available
|
||||
nix-shell -p git --run "git --version"
|
||||
|
||||
# Create backup directory (optional)
|
||||
mkdir -p ~/nixos-backups
|
||||
```
|
||||
|
||||
### 2. Repository Setup
|
||||
|
||||
```bash
|
||||
# Clone to home directory
|
||||
cd ~
|
||||
git clone https://github.com/thearctesian/omnixy
|
||||
cd omnixy
|
||||
|
||||
# Verify repository integrity
|
||||
ls -la # Should see flake.nix, configuration.nix, etc.
|
||||
nix flake check # Verify flake is valid
|
||||
```
|
||||
|
||||
### 3. Configuration Customization (Optional)
|
||||
|
||||
Before installation, you can customize:
|
||||
|
||||
```bash
|
||||
# Edit user configuration
|
||||
vim home.nix # Modify user packages and settings
|
||||
|
||||
# Modify system packages
|
||||
vim modules/packages.nix # Add/remove system packages
|
||||
|
||||
# Hardware-specific changes
|
||||
vim hardware-configuration.nix # Update for your hardware
|
||||
```
|
||||
|
||||
### 4. Installation Execution
|
||||
|
||||
Choose your preferred installer and run it:
|
||||
|
||||
```bash
|
||||
# Interactive (recommended for first-time users)
|
||||
./install.sh
|
||||
|
||||
# Simple (for automation)
|
||||
./install-simple.sh --user $USER --theme tokyo-night
|
||||
|
||||
# Manual (for experts)
|
||||
sudo nixos-rebuild switch --flake .#omnixy
|
||||
```
|
||||
|
||||
### 5. Post-Installation Configuration
|
||||
|
||||
After installation completes:
|
||||
|
||||
```bash
|
||||
# Verify installation
|
||||
omnixy info
|
||||
|
||||
# Check available commands
|
||||
omnixy help
|
||||
|
||||
# Test theme switching
|
||||
omnixy theme list
|
||||
omnixy theme set nord
|
||||
|
||||
# Verify system health
|
||||
systemctl status
|
||||
journalctl -b | grep -i error
|
||||
```
|
||||
|
||||
## Customization During Installation
|
||||
|
||||
### Theme Selection
|
||||
|
||||
Available themes during installation:
|
||||
1. **tokyo-night** (default) - Dark with vibrant blues
|
||||
2. **catppuccin** - Warm, soothing pastels
|
||||
3. **gruvbox** - Retro earth tones
|
||||
4. **nord** - Cool Arctic colors
|
||||
5. **everforest** - Natural greens
|
||||
6. **rose-pine** - Elegant pinks
|
||||
7. **kanagawa** - Japanese-inspired
|
||||
8. **catppuccin-latte** - Light variant
|
||||
9. **matte-black** - Minimal black/white
|
||||
10. **osaka-jade** - Jade greens
|
||||
11. **ristretto** - Coffee browns
|
||||
|
||||
### Feature Configuration
|
||||
|
||||
Optional features you can enable:
|
||||
|
||||
**Security Features**:
|
||||
- Fingerprint authentication
|
||||
- FIDO2 security keys
|
||||
- Two-factor authentication
|
||||
|
||||
**Development Features**:
|
||||
- Docker/Podman support
|
||||
- Development databases
|
||||
- Additional programming languages
|
||||
|
||||
**Gaming Features**:
|
||||
- Steam integration
|
||||
- Wine compatibility
|
||||
- Gaming optimizations
|
||||
|
||||
**Multimedia Features**:
|
||||
- Video editing tools
|
||||
- Audio production software
|
||||
- Graphics applications
|
||||
|
||||
### Hardware Configuration
|
||||
|
||||
The installer automatically detects and configures:
|
||||
- GPU drivers (Intel, AMD, NVIDIA)
|
||||
- Audio hardware (PipeWire setup)
|
||||
- Network interfaces
|
||||
- Bluetooth devices
|
||||
- Input devices (touchpad, etc.)
|
||||
|
||||
## Troubleshooting Installation
|
||||
|
||||
### Common Issues
|
||||
|
||||
**"Not running on NixOS" Error**:
|
||||
```bash
|
||||
# Verify NixOS installation
|
||||
ls /etc/NIXOS
|
||||
nixos-version
|
||||
```
|
||||
|
||||
**Permission Denied Errors**:
|
||||
```bash
|
||||
# Ensure user is in wheel group
|
||||
groups $USER | grep wheel
|
||||
|
||||
# Add user to wheel group if needed
|
||||
sudo usermod -aG wheel $USER
|
||||
```
|
||||
|
||||
**Network/Download Issues**:
|
||||
```bash
|
||||
# Test internet connectivity
|
||||
curl -I https://github.com
|
||||
ping -c 3 cache.nixos.org
|
||||
|
||||
# Check DNS resolution
|
||||
nslookup github.com
|
||||
```
|
||||
|
||||
**Insufficient Space**:
|
||||
```bash
|
||||
# Check available space
|
||||
df -h /
|
||||
du -sh /nix/store
|
||||
|
||||
# Clean up if needed
|
||||
nix-collect-garbage -d
|
||||
```
|
||||
|
||||
### Build Failures
|
||||
|
||||
**Flake Evaluation Errors**:
|
||||
```bash
|
||||
# Check flake syntax
|
||||
nix flake check --show-trace
|
||||
|
||||
# Debug with verbose output
|
||||
nixos-rebuild build --flake .#omnixy --show-trace
|
||||
```
|
||||
|
||||
**Package Build Failures**:
|
||||
```bash
|
||||
# Check for specific package errors
|
||||
journalctl -u nix-daemon | grep -i error
|
||||
|
||||
# Try building individual packages
|
||||
nix build .#omnixy-scripts
|
||||
```
|
||||
|
||||
**Out of Memory During Build**:
|
||||
```bash
|
||||
# Check memory usage
|
||||
free -h
|
||||
htop
|
||||
|
||||
# Enable swap if needed
|
||||
sudo swapon -a
|
||||
|
||||
# Build with fewer jobs
|
||||
nixos-rebuild build --flake .#omnixy --max-jobs 1
|
||||
```
|
||||
|
||||
### Recovery Options
|
||||
|
||||
**Rollback to Previous Configuration**:
|
||||
```bash
|
||||
# List available generations
|
||||
sudo nix-env --list-generations --profile /nix/var/nix/profiles/system
|
||||
|
||||
# Rollback to previous generation
|
||||
sudo nixos-rebuild switch --rollback
|
||||
```
|
||||
|
||||
**Restore from Backup**:
|
||||
```bash
|
||||
# If backup was created during installation
|
||||
sudo cp -r /etc/nixos.backup.TIMESTAMP/* /etc/nixos/
|
||||
sudo nixos-rebuild switch
|
||||
```
|
||||
|
||||
**Boot from Rescue Environment**:
|
||||
If the system fails to boot:
|
||||
1. Boot from NixOS live USB
|
||||
2. Mount the system
|
||||
3. Restore backup or rollback
|
||||
4. Rebuild system
|
||||
|
||||
## Verification and Testing
|
||||
|
||||
### Post-Installation Checks
|
||||
|
||||
```bash
|
||||
# System information
|
||||
omnixy info
|
||||
|
||||
# Theme verification
|
||||
omnixy theme get
|
||||
|
||||
# Package verification
|
||||
which alacritty hyprland waybar
|
||||
|
||||
# Service status
|
||||
systemctl --user status hyprland
|
||||
systemctl status NetworkManager
|
||||
```
|
||||
|
||||
### Functional Testing
|
||||
|
||||
```bash
|
||||
# Test theme switching
|
||||
omnixy theme set gruvbox
|
||||
omnixy theme set tokyo-night
|
||||
|
||||
# Test utilities
|
||||
omnixy-screenshot --help
|
||||
omnixy search firefox
|
||||
|
||||
# Test development environments
|
||||
nix develop .#rust --command rustc --version
|
||||
nix develop .#python --command python --version
|
||||
```
|
||||
|
||||
### Performance Verification
|
||||
|
||||
```bash
|
||||
# Check boot time
|
||||
systemd-analyze
|
||||
|
||||
# Check memory usage
|
||||
free -h
|
||||
ps aux --sort=-%mem | head
|
||||
|
||||
# Check disk usage
|
||||
df -h
|
||||
du -sh /nix/store
|
||||
```
|
||||
|
||||
## Next Steps After Installation
|
||||
|
||||
### Essential Configuration
|
||||
1. **Set up Git**: Configure name and email
|
||||
2. **Configure Shell**: Customize zsh/bash settings
|
||||
3. **Install Additional Software**: Add personal packages
|
||||
4. **Set up Development**: Configure programming environments
|
||||
|
||||
### System Maintenance
|
||||
```bash
|
||||
# Regular updates
|
||||
omnixy update
|
||||
|
||||
# Regular cleanup
|
||||
omnixy clean
|
||||
|
||||
# Monitor system health
|
||||
omnixy info
|
||||
```
|
||||
|
||||
### Customization
|
||||
1. **Explore Themes**: Try different color schemes
|
||||
2. **Customize Keybindings**: Modify Hyprland shortcuts
|
||||
3. **Add Packages**: Edit configuration files
|
||||
4. **Create Backups**: Regular system backups
|
||||
|
||||
This installation guide provides multiple paths to get OmniXY running on your system, accommodating different user preferences and technical backgrounds.
|
||||
98
docs/README.md
Normal file
98
docs/README.md
Normal file
@@ -0,0 +1,98 @@
|
||||
# OmniXY Documentation
|
||||
|
||||
## Overview
|
||||
OmniXY is a declarative, reproducible NixOS-based operating system focused on developer productivity and aesthetic customization. Built on top of NixOS, it provides a complete development environment with beautiful themes, modern tools, and a tiling window manager (Hyprland).
|
||||
|
||||
## Table of Contents
|
||||
- [Architecture Overview](./ARCHITECTURE.md)
|
||||
- [Installation Guide](./INSTALLATION.md)
|
||||
- [Configuration System](./CONFIGURATION.md)
|
||||
- [Theme System](./THEMES.md)
|
||||
- [Development Environment](./DEVELOPMENT.md)
|
||||
- [Command Reference](./COMMANDS.md)
|
||||
- [Troubleshooting](./TROUBLESHOOTING.md)
|
||||
|
||||
## Quick Start
|
||||
|
||||
1. **Install NixOS** - OmniXY requires a base NixOS installation
|
||||
2. **Run Bootstrap** - `curl -fsSL https://raw.githubusercontent.com/thearctesian/omnixy/main/boot.sh | bash`
|
||||
3. **Configure User** - Set your username and select a theme
|
||||
4. **Reboot** - Apply the new configuration
|
||||
|
||||
## Core Concepts
|
||||
|
||||
### Declarative Configuration
|
||||
Everything in OmniXY is defined through Nix expressions. Your entire system configuration—packages, services, themes, and settings—is declared in code and version controlled.
|
||||
|
||||
### Reproducibility
|
||||
The same configuration will produce identical systems across different machines. This is achieved through Nix's functional package management and flake lock files.
|
||||
|
||||
### Modularity
|
||||
The system is built from composable modules that can be enabled, disabled, or customized independently. Each module handles a specific aspect of the system.
|
||||
|
||||
### Immutability
|
||||
System packages and configurations are immutable once built. Changes require rebuilding the system, preventing configuration drift and ensuring consistency.
|
||||
|
||||
## System Components
|
||||
|
||||
### Base System (NixOS)
|
||||
- Functional package management
|
||||
- Atomic upgrades and rollbacks
|
||||
- Declarative system configuration
|
||||
- Reproducible builds
|
||||
|
||||
### Window Manager (Hyprland)
|
||||
- Dynamic tiling compositor for Wayland
|
||||
- Smooth animations and effects
|
||||
- Extensive customization options
|
||||
- Modern GPU-accelerated rendering
|
||||
|
||||
### Development Tools
|
||||
- Multiple language environments (Rust, Go, Python, Node.js, etc.)
|
||||
- Git integration with lazygit
|
||||
- Modern terminal emulators (Alacritty, Kitty)
|
||||
- Neovim with LazyVim configuration
|
||||
|
||||
### Theme System
|
||||
- 11 pre-configured color schemes
|
||||
- Unified theming across all applications
|
||||
- Easy theme switching with `omnixy theme set <name>`
|
||||
- Custom theme support
|
||||
|
||||
## Directory Structure
|
||||
|
||||
```
|
||||
omnixy/
|
||||
├── docs/ # This documentation
|
||||
├── configuration.nix # Main system configuration
|
||||
├── flake.nix # Flake definition with inputs/outputs
|
||||
├── home.nix # User environment configuration
|
||||
├── modules/ # System modules
|
||||
│ ├── themes/ # Theme definitions
|
||||
│ ├── hardware/ # Hardware configurations
|
||||
│ └── desktop/ # Desktop environment configs
|
||||
├── packages/ # Custom Nix packages
|
||||
└── scripts/ # Unix philosophy utilities
|
||||
```
|
||||
|
||||
## Philosophy
|
||||
|
||||
OmniXY follows these principles:
|
||||
|
||||
1. **Declarative Over Imperative** - Define what you want, not how to get it
|
||||
2. **Reproducible Builds** - Same input always produces same output
|
||||
3. **Unix Philosophy** - Tools that do one thing well
|
||||
4. **Developer First** - Optimized for programming workflows
|
||||
5. **Beautiful Defaults** - Aesthetic out of the box
|
||||
6. **Extensible** - Easy to customize and extend
|
||||
|
||||
## Getting Help
|
||||
|
||||
- **Command Help**: `omnixy help`
|
||||
- **System Info**: `omnixy info`
|
||||
- **GitHub Issues**: https://github.com/TheArctesian/omnixy/issues
|
||||
- **NixOS Manual**: https://nixos.org/manual/nixos/stable/
|
||||
|
||||
## Contributing
|
||||
|
||||
OmniXY is open source and welcomes contributions. See the main README for contribution guidelines.
|
||||
@@ -93,7 +93,7 @@
|
||||
packages = with pkgs; [
|
||||
# Development tools
|
||||
git
|
||||
neovim
|
||||
# neovim (configured via home-manager)
|
||||
ripgrep
|
||||
fd
|
||||
bat
|
||||
|
||||
2
home.nix
2
home.nix
@@ -28,7 +28,7 @@
|
||||
xplr
|
||||
|
||||
# Development tools
|
||||
neovim
|
||||
# neovim (configured via programs.neovim)
|
||||
vscode
|
||||
lazygit
|
||||
gh
|
||||
|
||||
126
install-simple.sh
Executable file
126
install-simple.sh
Executable file
@@ -0,0 +1,126 @@
|
||||
#!/usr/bin/env bash
|
||||
# Simple, Unix-philosophy compliant installer
|
||||
# Does one thing: installs OmniXY configuration
|
||||
set -e
|
||||
|
||||
show_usage() {
|
||||
cat << 'EOF'
|
||||
Usage: install-simple.sh [options]
|
||||
|
||||
Options:
|
||||
--user USERNAME Set username (default: prompt)
|
||||
--theme THEME Set theme (default: tokyo-night)
|
||||
--quiet, -q Quiet operation
|
||||
--dry-run, -n Test configuration without switching
|
||||
--help, -h Show this help
|
||||
|
||||
Environment:
|
||||
OMNIXY_QUIET=1 Enable quiet mode
|
||||
OMNIXY_USER Default username
|
||||
OMNIXY_THEME Default theme
|
||||
|
||||
Examples:
|
||||
./install-simple.sh --user alice --theme gruvbox
|
||||
./install-simple.sh --quiet --dry-run
|
||||
OMNIXY_USER=bob ./install-simple.sh
|
||||
|
||||
This installer follows Unix philosophy:
|
||||
- Does one job: install configuration
|
||||
- Accepts arguments instead of interactive prompts
|
||||
- Produces clean, pipeable output
|
||||
- Can be scripted and automated
|
||||
EOF
|
||||
}
|
||||
|
||||
main() {
|
||||
local username="${OMNIXY_USER:-}"
|
||||
local theme="${OMNIXY_THEME:-tokyo-night}"
|
||||
local quiet=false
|
||||
local dry_run=false
|
||||
|
||||
# Parse arguments
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--user)
|
||||
username="$2"
|
||||
shift 2
|
||||
;;
|
||||
--theme)
|
||||
theme="$2"
|
||||
shift 2
|
||||
;;
|
||||
--quiet|-q)
|
||||
quiet=true
|
||||
export OMNIXY_QUIET=1
|
||||
shift
|
||||
;;
|
||||
--dry-run|-n)
|
||||
dry_run=true
|
||||
shift
|
||||
;;
|
||||
--help|-h)
|
||||
show_usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $1" >&2
|
||||
echo "Use --help for usage information" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Make scripts executable
|
||||
chmod +x scripts/omnixy-* 2>/dev/null || true
|
||||
|
||||
# Step 1: Check system (exit early if problems)
|
||||
[[ "$quiet" != "true" ]] && echo "Checking system requirements..."
|
||||
scripts/omnixy-check-system
|
||||
|
||||
# Step 2: Backup existing config
|
||||
[[ "$quiet" != "true" ]] && echo "Backing up configuration..."
|
||||
backup_path=$(scripts/omnixy-backup-config)
|
||||
[[ "$quiet" != "true" ]] && echo "Backup created: $backup_path"
|
||||
|
||||
# Step 3: Install files
|
||||
[[ "$quiet" != "true" ]] && echo "Installing configuration files..."
|
||||
scripts/omnixy-install-files
|
||||
|
||||
# Step 4: Configure user
|
||||
if [[ -n "$username" ]]; then
|
||||
[[ "$quiet" != "true" ]] && echo "Configuring user: $username"
|
||||
scripts/omnixy-configure-user "$username"
|
||||
else
|
||||
[[ "$quiet" != "true" ]] && echo "Configuring user..."
|
||||
username=$(scripts/omnixy-configure-user)
|
||||
fi
|
||||
|
||||
# Step 5: Set theme
|
||||
if [[ "$theme" != "tokyo-night" ]]; then
|
||||
[[ "$quiet" != "true" ]] && echo "Setting theme: $theme"
|
||||
sudo sed -i "s/currentTheme = \".*\"/currentTheme = \"$theme\"/" /etc/nixos/configuration.nix
|
||||
fi
|
||||
|
||||
# Step 6: Build system
|
||||
if [[ "$dry_run" == "true" ]]; then
|
||||
[[ "$quiet" != "true" ]] && echo "Testing configuration (dry run)..."
|
||||
scripts/omnixy-build-system --dry-run
|
||||
echo "Configuration test successful. Run without --dry-run to apply."
|
||||
else
|
||||
[[ "$quiet" != "true" ]] && echo "Building system configuration..."
|
||||
scripts/omnixy-build-system
|
||||
|
||||
[[ "$quiet" != "true" ]] && cat << EOF
|
||||
|
||||
✅ OmniXY installation complete!
|
||||
|
||||
User: $username
|
||||
Theme: $theme
|
||||
Backup: $backup_path
|
||||
|
||||
Reboot to ensure all changes take effect.
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -113,7 +113,7 @@ show_banner() {
|
||||
|
||||
# Subtitle with typewriter effect
|
||||
printf "%*s" $(( (TERM_WIDTH - 40) / 2 )) ""
|
||||
animate_text "🚀 Declarative • 🎨 Beautiful • ⚡ Fast" "$CYAN" 0.05
|
||||
animate_text "Welcome to the linux world" "$CYAN" 0.05
|
||||
echo
|
||||
echo
|
||||
|
||||
|
||||
269
modules/README.md
Normal file
269
modules/README.md
Normal file
@@ -0,0 +1,269 @@
|
||||
# Modules Directory
|
||||
|
||||
The `modules/` directory contains the modular NixOS configuration system that makes up OmniXY. Each module is responsible for a specific aspect of the system and can be enabled, disabled, or configured independently.
|
||||
|
||||
## Module Architecture
|
||||
|
||||
Each module follows the standard NixOS module structure:
|
||||
```nix
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
{
|
||||
options = {
|
||||
# Configuration options for this module
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Module implementation
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## Core System Modules
|
||||
|
||||
### `core.nix`
|
||||
**Purpose**: Base system settings and OmniXY-specific options
|
||||
**What it configures**:
|
||||
- Essential system services (NetworkManager, Bluetooth, Audio)
|
||||
- Graphics support (OpenGL/Vulkan)
|
||||
- Font management
|
||||
- Basic security settings
|
||||
- OmniXY module system foundations
|
||||
|
||||
**Key Features**:
|
||||
- Automatic hardware graphics detection
|
||||
- Unified font configuration across the system
|
||||
- Essential service enablement
|
||||
- Module option definitions
|
||||
|
||||
### `packages.nix`
|
||||
**Purpose**: System-wide package management with feature categories
|
||||
**What it manages**:
|
||||
- Base system packages (editors, terminals, file managers)
|
||||
- Development tools and languages
|
||||
- Media and graphics applications
|
||||
- Gaming packages (optional)
|
||||
- Productivity software
|
||||
|
||||
**Categories**:
|
||||
- `base`: Essential system utilities
|
||||
- `development`: Programming tools and IDEs
|
||||
- `media`: Audio/video applications
|
||||
- `graphics`: Image editing and design tools
|
||||
- `gaming`: Games and gaming platforms
|
||||
- `productivity`: Office and productivity suites
|
||||
|
||||
### `services.nix`
|
||||
**Purpose**: System service configuration and management
|
||||
**What it configures**:
|
||||
- Display manager (GDM)
|
||||
- Audio system (PipeWire)
|
||||
- Network services
|
||||
- Container services (Docker, Podman)
|
||||
- Development services (databases, etc.)
|
||||
|
||||
**Service Categories**:
|
||||
- Desktop services (compositor, display manager)
|
||||
- Audio/media services
|
||||
- Network and connectivity
|
||||
- Development and container services
|
||||
|
||||
### `users.nix`
|
||||
**Purpose**: User account management and configuration
|
||||
**What it manages**:
|
||||
- User account creation and settings
|
||||
- Shell configuration defaults
|
||||
- User group memberships
|
||||
- Home directory setup
|
||||
|
||||
**Features**:
|
||||
- Automatic user creation based on configuration
|
||||
- Shell preferences (zsh as default)
|
||||
- Group membership for hardware access
|
||||
- Integration with home-manager
|
||||
|
||||
## Security and System
|
||||
|
||||
### `security.nix`
|
||||
**Purpose**: Security settings and authentication methods
|
||||
**What it configures**:
|
||||
- Multi-factor authentication
|
||||
- Fingerprint support (fprintd)
|
||||
- FIDO2 security keys
|
||||
- System hardening options
|
||||
- Firewall configuration
|
||||
|
||||
**Authentication Methods**:
|
||||
- Password authentication
|
||||
- Fingerprint recognition
|
||||
- FIDO2/WebAuthn security keys
|
||||
- Two-factor authentication
|
||||
|
||||
### `boot.nix`
|
||||
**Purpose**: Boot system and kernel configuration
|
||||
**What it manages**:
|
||||
- Boot loader configuration (systemd-boot)
|
||||
- Kernel parameters and modules
|
||||
- Plymouth boot theme
|
||||
- Early boot optimizations
|
||||
|
||||
**Boot Features**:
|
||||
- Fast boot configuration
|
||||
- Kernel optimization
|
||||
- Boot splash screen
|
||||
- Hardware initialization
|
||||
|
||||
## User Interface
|
||||
|
||||
### `menus.nix`
|
||||
**Purpose**: Application menus and launchers
|
||||
**What it configures**:
|
||||
- Application launchers (rofi alternatives)
|
||||
- Desktop menu systems
|
||||
- Quick access interfaces
|
||||
- Search functionality
|
||||
|
||||
### `walker.nix`
|
||||
**Purpose**: Walker application launcher configuration
|
||||
**What it manages**:
|
||||
- Walker launcher settings
|
||||
- Search backends and plugins
|
||||
- Keybindings and interface
|
||||
- Theme integration
|
||||
|
||||
### `fastfetch.nix`
|
||||
**Purpose**: System information display tool
|
||||
**What it configures**:
|
||||
- System info formatting
|
||||
- Logo and branding display
|
||||
- Performance metrics
|
||||
- Terminal integration
|
||||
|
||||
## Development Environment
|
||||
|
||||
### `development.nix`
|
||||
**Purpose**: Development tools and programming environments
|
||||
**What it provides**:
|
||||
- Multiple language support (Rust, Go, Python, Node.js, C/C++)
|
||||
- Language servers and tools
|
||||
- Git configuration and tools
|
||||
- Development containers and databases
|
||||
|
||||
**Language Support**:
|
||||
- Runtime environments
|
||||
- Package managers
|
||||
- Language-specific tools
|
||||
- IDE and editor integration
|
||||
|
||||
### `scripts.nix`
|
||||
**Purpose**: OmniXY utility script management
|
||||
**What it manages**:
|
||||
- System management scripts
|
||||
- Theme switching utilities
|
||||
- Development helper scripts
|
||||
- Unix philosophy tools
|
||||
|
||||
## Hardware Support
|
||||
|
||||
The `hardware/` subdirectory contains hardware-specific modules:
|
||||
|
||||
### `default.nix`
|
||||
**Purpose**: Hardware detection and automatic configuration
|
||||
**What it does**:
|
||||
- Detects available hardware
|
||||
- Enables appropriate drivers
|
||||
- Configures hardware-specific settings
|
||||
- Imports relevant hardware modules
|
||||
|
||||
### GPU Support
|
||||
- `amd.nix`: AMD GPU drivers and configuration
|
||||
- `intel.nix`: Intel integrated graphics
|
||||
- `nvidia.nix`: NVIDIA proprietary drivers
|
||||
|
||||
### Audio and Input
|
||||
- `audio.nix`: Audio system configuration
|
||||
- `touchpad.nix`: Laptop touchpad settings
|
||||
- `bluetooth.nix`: Bluetooth device support
|
||||
|
||||
## Theme System
|
||||
|
||||
The `themes/` subdirectory contains complete theme definitions:
|
||||
|
||||
Each theme module (e.g., `tokyo-night.nix`) configures:
|
||||
- Color palette definitions
|
||||
- Terminal color schemes
|
||||
- Editor themes (Neovim, VSCode)
|
||||
- Desktop component theming (Waybar, Hyprland)
|
||||
- GTK/Qt application themes
|
||||
|
||||
## Desktop Environment
|
||||
|
||||
The `desktop/` subdirectory contains desktop-specific configurations:
|
||||
|
||||
### `hyprland.nix`
|
||||
**Purpose**: Hyprland compositor configuration
|
||||
**Sub-modules**:
|
||||
- `bindings.nix`: Keyboard shortcuts and bindings
|
||||
- `autostart.nix`: Applications started with the desktop
|
||||
- `idle.nix`: Idle management and screen locking
|
||||
|
||||
## Utility Modules
|
||||
|
||||
### `lib.nix`
|
||||
**Purpose**: Shared library functions and utilities
|
||||
**What it provides**:
|
||||
- Helper functions used across modules
|
||||
- Common configuration patterns
|
||||
- Utility functions for theme and configuration management
|
||||
|
||||
### `colors.nix`
|
||||
**Purpose**: Color management and palette definitions
|
||||
**What it manages**:
|
||||
- Color space conversions
|
||||
- Palette generation utilities
|
||||
- Theme color validation
|
||||
|
||||
### `helpers.nix`
|
||||
**Purpose**: Additional helper functions
|
||||
**What it provides**:
|
||||
- File and directory utilities
|
||||
- Configuration templating functions
|
||||
- System integration helpers
|
||||
|
||||
## Module Dependencies
|
||||
|
||||
```
|
||||
core.nix (foundation)
|
||||
↓
|
||||
packages.nix + services.nix (system layer)
|
||||
↓
|
||||
security.nix + boot.nix (system hardening)
|
||||
↓
|
||||
themes/*.nix (visual layer)
|
||||
↓
|
||||
desktop/*.nix (user interface)
|
||||
↓
|
||||
development.nix (developer tools)
|
||||
```
|
||||
|
||||
## Adding New Modules
|
||||
|
||||
To add a new module:
|
||||
|
||||
1. Create the module file in the appropriate subdirectory
|
||||
2. Follow the standard NixOS module structure
|
||||
3. Define clear options with types and descriptions
|
||||
4. Import the module in `configuration.nix`
|
||||
5. Document the module's purpose and options
|
||||
6. Test the module in isolation and with others
|
||||
|
||||
## Module Best Practices
|
||||
|
||||
1. **Single Responsibility**: Each module handles one aspect
|
||||
2. **Clear Options**: Well-defined configuration interface
|
||||
3. **Documentation**: Comments and option descriptions
|
||||
4. **Dependencies**: Explicit module dependencies
|
||||
5. **Testing**: Verify module works in isolation
|
||||
6. **Performance**: Efficient evaluation and build times
|
||||
|
||||
This modular architecture makes OmniXY highly customizable while maintaining clean separation of concerns.
|
||||
@@ -42,6 +42,8 @@ in
|
||||
"boot.shell_on_fail"
|
||||
# Hide cursor
|
||||
"vt.global_cursor_default=0"
|
||||
# Security: Disable emergency shell access
|
||||
"systemd.debug-shell=0"
|
||||
];
|
||||
|
||||
# Console configuration for seamless experience
|
||||
@@ -80,7 +82,6 @@ in
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = "${pkgs.plymouth}/bin/plymouth message --text='Welcome to OmniXY'";
|
||||
ExecStop = "${pkgs.plymouth}/bin/plymouth quit --retain-splash";
|
||||
TimeoutStartSec = "10s";
|
||||
};
|
||||
@@ -234,16 +235,10 @@ in
|
||||
fontDir.enable = true;
|
||||
};
|
||||
|
||||
# Security: Disable debug shell during boot (can be enabled for troubleshooting)
|
||||
boot.kernelParams = mkDefault [
|
||||
# Disable emergency shell access
|
||||
"systemd.debug-shell=0"
|
||||
];
|
||||
# Security settings are now included in boot.kernelParams above
|
||||
|
||||
# Optional: LUKS integration for encrypted systems
|
||||
boot.initrd.luks.devices = mkIf (config.boot.initrd.luks.devices != {}) {
|
||||
# Plymouth will automatically handle LUKS password prompts
|
||||
};
|
||||
# Plymouth will automatically handle LUKS password prompts when LUKS devices are configured
|
||||
|
||||
# Console and TTY configuration
|
||||
console = {
|
||||
|
||||
333
modules/desktop/README.md
Normal file
333
modules/desktop/README.md
Normal file
@@ -0,0 +1,333 @@
|
||||
# Desktop Directory - Desktop Environment Configuration
|
||||
|
||||
The `modules/desktop/` directory contains the desktop environment configuration for OmniXY, centered around the Hyprland compositor. This directory manages the complete desktop experience including window management, user interface, and desktop interactions.
|
||||
|
||||
## Desktop Architecture
|
||||
|
||||
The desktop system is built in layers:
|
||||
```
|
||||
User Interaction Layer (keybindings, gestures)
|
||||
↓
|
||||
Application Layer (autostart, window rules)
|
||||
↓
|
||||
Compositor Layer (Hyprland core)
|
||||
↓
|
||||
System Integration Layer (services, hardware)
|
||||
```
|
||||
|
||||
## Core Desktop Module
|
||||
|
||||
### `hyprland.nix`
|
||||
**Purpose**: Main Hyprland compositor configuration and coordination
|
||||
**What it provides**:
|
||||
- Core Hyprland configuration
|
||||
- Integration with other desktop components
|
||||
- Theme-aware window management
|
||||
- Performance optimizations
|
||||
|
||||
**Key Features**:
|
||||
- Wayland-native compositor
|
||||
- Dynamic tiling window management
|
||||
- Smooth animations and effects
|
||||
- GPU-accelerated rendering
|
||||
- Extensive customization options
|
||||
|
||||
**Module Structure**:
|
||||
```nix
|
||||
imports = [
|
||||
./hyprland/bindings.nix
|
||||
./hyprland/autostart.nix
|
||||
./hyprland/idle.nix
|
||||
];
|
||||
```
|
||||
|
||||
## Hyprland Sub-Modules
|
||||
|
||||
### `hyprland/bindings.nix`
|
||||
**Purpose**: Keyboard shortcuts and input bindings
|
||||
**What it configures**:
|
||||
- Window management shortcuts
|
||||
- Application launching bindings
|
||||
- Workspace navigation
|
||||
- System control shortcuts
|
||||
|
||||
**Key Binding Categories**:
|
||||
|
||||
#### Window Management
|
||||
- `Super + Q`: Close window
|
||||
- `Super + F`: Toggle fullscreen
|
||||
- `Super + Space`: Toggle floating
|
||||
- `Super + V`: Toggle split direction
|
||||
- `Super + Arrow Keys`: Move window focus
|
||||
- `Super + Shift + Arrow Keys`: Move windows
|
||||
|
||||
#### Application Launching
|
||||
- `Super + Return`: Terminal (Alacritty)
|
||||
- `Super + B`: Web browser
|
||||
- `Super + E`: File manager
|
||||
- `Super + D`: Application launcher
|
||||
- `Super + R`: Run dialog
|
||||
|
||||
#### Workspace Management
|
||||
- `Super + 1-9`: Switch to workspace
|
||||
- `Super + Shift + 1-9`: Move window to workspace
|
||||
- `Super + Mouse Wheel`: Cycle through workspaces
|
||||
- `Super + Tab`: Application switcher
|
||||
|
||||
#### System Controls
|
||||
- `Super + L`: Lock screen
|
||||
- `Super + Shift + E`: Logout menu
|
||||
- `Volume Keys`: Audio control
|
||||
- `Brightness Keys`: Display brightness
|
||||
- `Print`: Screenshot region
|
||||
- `Shift + Print`: Screenshot full screen
|
||||
|
||||
#### Advanced Bindings
|
||||
- `Super + Alt + Arrow Keys`: Resize windows
|
||||
- `Super + Mouse`: Move/resize windows
|
||||
- `Super + Shift + S`: Screenshot with selection
|
||||
- `Super + P`: Power menu
|
||||
|
||||
### `hyprland/autostart.nix`
|
||||
**Purpose**: Applications and services started with the desktop session
|
||||
**What it manages**:
|
||||
- Essential desktop services
|
||||
- User applications
|
||||
- Background processes
|
||||
- System tray applications
|
||||
|
||||
**Autostart Categories**:
|
||||
|
||||
#### Essential Services
|
||||
- **Waybar**: Desktop panel/taskbar
|
||||
- **Mako**: Notification daemon
|
||||
- **Authentication Agent**: Polkit authentication
|
||||
- **Network Manager Applet**: Network connectivity
|
||||
|
||||
#### Background Services
|
||||
- **Clipboard Manager**: Clipboard history
|
||||
- **Wallpaper Setter**: Dynamic wallpapers
|
||||
- **Idle Manager**: Screen timeout and locking
|
||||
- **Audio Control**: Volume control daemon
|
||||
|
||||
#### User Applications (Optional)
|
||||
- **File Manager**: Background file operations
|
||||
- **Chat Applications**: Discord, Slack, etc.
|
||||
- **Productivity Tools**: Note-taking, calendar
|
||||
- **Development Tools**: IDEs, terminals
|
||||
|
||||
**Configuration Example**:
|
||||
```nix
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
exec-once = [
|
||||
"waybar"
|
||||
"mako"
|
||||
"nm-applet --indicator"
|
||||
"/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1"
|
||||
];
|
||||
};
|
||||
```
|
||||
|
||||
### `hyprland/idle.nix`
|
||||
**Purpose**: Idle management and screen locking
|
||||
**What it configures**:
|
||||
- Screen timeout settings
|
||||
- Automatic screen locking
|
||||
- Display power management
|
||||
- Suspend/hibernate behavior
|
||||
|
||||
**Idle Management Features**:
|
||||
|
||||
#### Screen Locking
|
||||
- Automatic lock after inactivity
|
||||
- Manual lock with keybinding
|
||||
- Grace period for quick unlock
|
||||
- Secure lock screen (swaylock)
|
||||
|
||||
#### Display Management
|
||||
- Screen dimming before lock
|
||||
- Display turn-off timing
|
||||
- Multiple monitor handling
|
||||
- Brightness restoration
|
||||
|
||||
#### Power Management
|
||||
- Suspend after extended idle
|
||||
- Hibernate for long inactivity
|
||||
- Wake-on-input configuration
|
||||
- Battery-aware timeouts
|
||||
|
||||
**Configuration Options**:
|
||||
```nix
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
after_sleep_cmd = "hyprctl dispatch dpms on";
|
||||
before_sleep_cmd = "loginctl lock-session";
|
||||
ignore_dbus_inhibit = false;
|
||||
lock_cmd = "pidof hyprlock || hyprlock";
|
||||
};
|
||||
|
||||
listener = [
|
||||
{
|
||||
timeout = 300; # 5 minutes
|
||||
on-timeout = "brightnessctl -s set 10";
|
||||
on-resume = "brightnessctl -r";
|
||||
}
|
||||
{
|
||||
timeout = 600; # 10 minutes
|
||||
on-timeout = "loginctl lock-session";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
## Window Management Features
|
||||
|
||||
### Tiling Behavior
|
||||
- **Dynamic Tiling**: Automatic window arrangement
|
||||
- **Manual Tiling**: User-controlled window placement
|
||||
- **Floating Windows**: Support for floating applications
|
||||
- **Split Layouts**: Horizontal and vertical splits
|
||||
|
||||
### Window Rules
|
||||
- **Application-Specific Rules**: Size, position, workspace assignment
|
||||
- **Floating Applications**: Always-float for certain apps
|
||||
- **Workspace Assignment**: Auto-assign apps to specific workspaces
|
||||
- **Focus Behavior**: Control focus stealing and new window focus
|
||||
|
||||
### Animation System
|
||||
- **Window Animations**: Smooth open/close transitions
|
||||
- **Workspace Transitions**: Fluid workspace switching
|
||||
- **Resize Animations**: Smooth window resizing
|
||||
- **Fade Effects**: Window fade in/out
|
||||
|
||||
## Desktop Integration
|
||||
|
||||
### Theme Integration
|
||||
Desktop components automatically adapt to the selected theme:
|
||||
- Window border colors
|
||||
- Panel/taskbar theming
|
||||
- Icon themes
|
||||
- Cursor themes
|
||||
|
||||
### Hardware Integration
|
||||
- **GPU Acceleration**: Optimal performance on all graphics hardware
|
||||
- **Multi-Monitor**: Automatic detection and configuration
|
||||
- **HiDPI Support**: Proper scaling for high-resolution displays
|
||||
- **Input Devices**: Touchpad gestures, mouse sensitivity
|
||||
|
||||
### Audio Integration
|
||||
- **Media Keys**: Hardware media key support
|
||||
- **Volume Control**: On-screen volume indicators
|
||||
- **Audio Device Switching**: Quick audio output switching
|
||||
- **Notification Sounds**: System sound integration
|
||||
|
||||
## Performance Optimization
|
||||
|
||||
### GPU Optimization
|
||||
- **Hardware Acceleration**: GPU-accelerated compositing
|
||||
- **VSync Configuration**: Tear-free rendering
|
||||
- **Frame Rate Management**: Adaptive refresh rates
|
||||
- **Multi-GPU Support**: Optimal GPU selection
|
||||
|
||||
### Memory Management
|
||||
- **Efficient Compositing**: Minimal memory usage
|
||||
- **Background Process Limits**: Control background applications
|
||||
- **Cache Management**: Optimal caching strategies
|
||||
- **Resource Monitoring**: System resource awareness
|
||||
|
||||
### Battery Optimization (Laptops)
|
||||
- **Power-Aware Rendering**: Reduced effects on battery
|
||||
- **CPU Scaling**: Dynamic performance scaling
|
||||
- **Display Brightness**: Automatic brightness adjustment
|
||||
- **Background Process Management**: Suspend non-essential processes
|
||||
|
||||
## Customization Options
|
||||
|
||||
### Layout Customization
|
||||
```nix
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
general = {
|
||||
gaps_in = 5;
|
||||
gaps_out = 10;
|
||||
border_size = 2;
|
||||
layout = "dwindle"; # or "master"
|
||||
};
|
||||
|
||||
decoration = {
|
||||
rounding = 10;
|
||||
blur = {
|
||||
enabled = true;
|
||||
size = 8;
|
||||
passes = 1;
|
||||
};
|
||||
drop_shadow = true;
|
||||
shadow_range = 4;
|
||||
shadow_render_power = 3;
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
### Animation Customization
|
||||
```nix
|
||||
animation = {
|
||||
enabled = true;
|
||||
bezier = [
|
||||
"wind, 0.05, 0.9, 0.1, 1.05"
|
||||
"winIn, 0.1, 1.1, 0.1, 1.1"
|
||||
"winOut, 0.3, -0.3, 0, 1"
|
||||
];
|
||||
|
||||
animation = [
|
||||
"windows, 1, 6, wind, slide"
|
||||
"windowsIn, 1, 6, winIn, slide"
|
||||
"windowsOut, 1, 5, winOut, slide"
|
||||
"fade, 1, 10, default"
|
||||
"workspaces, 1, 5, wind"
|
||||
];
|
||||
};
|
||||
```
|
||||
|
||||
## Desktop Components Integration
|
||||
|
||||
### Panel (Waybar)
|
||||
- System status display
|
||||
- Workspace indicators
|
||||
- System tray integration
|
||||
- Custom module support
|
||||
|
||||
### Application Launcher
|
||||
- Quick application access
|
||||
- Search functionality
|
||||
- Recent application history
|
||||
- Customizable appearance
|
||||
|
||||
### File Manager Integration
|
||||
- Desktop file operations
|
||||
- Trash management
|
||||
- Network location access
|
||||
- Archive handling
|
||||
|
||||
### Notification System
|
||||
- Desktop notifications
|
||||
- Notification history
|
||||
- Do-not-disturb modes
|
||||
- Custom notification rules
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
- **Performance Problems**: Check GPU acceleration
|
||||
- **Input Issues**: Verify input device configuration
|
||||
- **Display Problems**: Check monitor configuration
|
||||
- **Audio Issues**: Verify PipeWire integration
|
||||
|
||||
### Debugging Tools
|
||||
- `hyprctl`: Hyprland control utility
|
||||
- `waybar-log`: Panel debugging
|
||||
- `journalctl`: System logs
|
||||
- `htop`: Resource monitoring
|
||||
|
||||
This desktop configuration provides a modern, efficient, and highly customizable desktop environment that adapts to user preferences while maintaining excellent performance across various hardware configurations.
|
||||
@@ -19,7 +19,7 @@ in
|
||||
hub
|
||||
|
||||
# Editors and IDEs
|
||||
neovim
|
||||
# neovim (configured via home-manager programs.neovim)
|
||||
vscode
|
||||
vim
|
||||
emacs
|
||||
|
||||
@@ -11,9 +11,26 @@ let
|
||||
in
|
||||
{
|
||||
config = mkIf (cfg.enable or true) {
|
||||
# Add fastfetch to system packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Add fastfetch and convenience scripts to system packages
|
||||
environment.systemPackages = (with pkgs; [
|
||||
fastfetch
|
||||
]) ++ [
|
||||
# Convenience scripts
|
||||
(omnixy.makeScript "omnixy-info" "Show OmniXY system information" ''
|
||||
fastfetch --config /etc/omnixy/fastfetch/config.jsonc
|
||||
'')
|
||||
|
||||
(omnixy.makeScript "omnixy-about" "Show OmniXY about screen" ''
|
||||
clear
|
||||
cat /etc/omnixy/branding/about.txt
|
||||
echo
|
||||
echo "Theme: ${cfg.theme}"
|
||||
echo "Preset: ${cfg.preset or "custom"}"
|
||||
echo "User: ${cfg.user}"
|
||||
echo "NixOS Version: $(nixos-version)"
|
||||
echo
|
||||
echo "Visit: https://github.com/TheArctesian/omnixy"
|
||||
'')
|
||||
];
|
||||
|
||||
# Create OmniXY branding directory
|
||||
@@ -164,27 +181,10 @@ in
|
||||
}
|
||||
'';
|
||||
|
||||
# Create convenience script
|
||||
environment.systemPackages = [
|
||||
(omnixy.makeScript "omnixy-info" "Show OmniXY system information" ''
|
||||
fastfetch --config /etc/omnixy/fastfetch/config.jsonc
|
||||
'')
|
||||
|
||||
(omnixy.makeScript "omnixy-about" "Show OmniXY about screen" ''
|
||||
clear
|
||||
cat /etc/omnixy/branding/about.txt
|
||||
echo
|
||||
echo "Theme: ${cfg.theme}"
|
||||
echo "Preset: ${cfg.preset or "custom"}"
|
||||
echo "User: ${cfg.user}"
|
||||
echo "NixOS Version: $(nixos-version)"
|
||||
echo
|
||||
echo "Visit: https://github.com/TheArctesian/omnixy"
|
||||
'')
|
||||
];
|
||||
# Convenience scripts are now consolidated above
|
||||
|
||||
# Add to user environment
|
||||
omnixy.forUser {
|
||||
home-manager.users.${config.omnixy.user} = {
|
||||
# Set XDG config dir for fastfetch
|
||||
xdg.configFile."fastfetch/config.jsonc".source =
|
||||
config.environment.etc."omnixy/fastfetch/config.jsonc".source;
|
||||
|
||||
348
modules/hardware/README.md
Normal file
348
modules/hardware/README.md
Normal file
@@ -0,0 +1,348 @@
|
||||
# Hardware Directory - Hardware Support Modules
|
||||
|
||||
The `modules/hardware/` directory contains specialized modules for hardware detection, configuration, and optimization. These modules automatically detect available hardware and configure appropriate drivers, settings, and optimizations.
|
||||
|
||||
## Hardware Architecture
|
||||
|
||||
The hardware system uses conditional configuration based on detected hardware:
|
||||
```nix
|
||||
config = lib.mkIf cfg.hardware.nvidia.enable {
|
||||
# NVIDIA-specific configuration only when NVIDIA hardware is present
|
||||
};
|
||||
```
|
||||
|
||||
## Core Hardware Module
|
||||
|
||||
### `default.nix`
|
||||
**Purpose**: Main hardware detection and coordination module
|
||||
**What it does**:
|
||||
- Detects available hardware components
|
||||
- Enables appropriate hardware-specific modules
|
||||
- Coordinates between different hardware configurations
|
||||
- Provides common hardware configuration options
|
||||
|
||||
**Detection Logic**:
|
||||
- GPU detection (Intel, AMD, NVIDIA)
|
||||
- Audio hardware identification
|
||||
- Input device configuration
|
||||
- Network hardware setup
|
||||
|
||||
**Module Coordination**:
|
||||
```nix
|
||||
imports = [
|
||||
./audio.nix
|
||||
./bluetooth.nix
|
||||
./intel.nix
|
||||
./amd.nix
|
||||
./nvidia.nix
|
||||
./touchpad.nix
|
||||
];
|
||||
```
|
||||
|
||||
## Graphics Hardware
|
||||
|
||||
### `intel.nix`
|
||||
**Purpose**: Intel integrated graphics configuration
|
||||
**Hardware Support**:
|
||||
- Intel HD Graphics (all generations)
|
||||
- Intel Iris Graphics
|
||||
- Intel Arc discrete graphics
|
||||
|
||||
**What it configures**:
|
||||
- Intel graphics drivers (i915)
|
||||
- Hardware acceleration (VA-API)
|
||||
- Power management optimizations
|
||||
- Display output configuration
|
||||
|
||||
**Features**:
|
||||
- Vulkan support for gaming
|
||||
- Hardware video decoding
|
||||
- Power-efficient graphics scaling
|
||||
- Multi-monitor support
|
||||
|
||||
**Configuration Options**:
|
||||
```nix
|
||||
omnixy.hardware.intel = {
|
||||
enable = true;
|
||||
powerSaving = true; # Enable power optimizations
|
||||
vulkan = true; # Enable Vulkan API support
|
||||
};
|
||||
```
|
||||
|
||||
### `amd.nix`
|
||||
**Purpose**: AMD graphics card configuration
|
||||
**Hardware Support**:
|
||||
- AMD Radeon RX series
|
||||
- AMD Radeon Pro series
|
||||
- AMD APU integrated graphics
|
||||
|
||||
**What it configures**:
|
||||
- AMDGPU drivers (open-source)
|
||||
- RADV Vulkan drivers
|
||||
- Hardware acceleration (VA-API/VDPAU)
|
||||
- OpenCL compute support
|
||||
|
||||
**Features**:
|
||||
- Gaming optimizations
|
||||
- Content creation acceleration
|
||||
- Multi-GPU configurations
|
||||
- FreeSync support
|
||||
|
||||
**Performance Tuning**:
|
||||
- Dynamic frequency scaling
|
||||
- Power management profiles
|
||||
- Thermal management
|
||||
- Memory clock optimization
|
||||
|
||||
### `nvidia.nix`
|
||||
**Purpose**: NVIDIA graphics card configuration
|
||||
**Hardware Support**:
|
||||
- NVIDIA GeForce RTX/GTX series
|
||||
- NVIDIA Quadro professional cards
|
||||
- NVIDIA Tesla compute cards
|
||||
|
||||
**What it configures**:
|
||||
- Proprietary NVIDIA drivers
|
||||
- CUDA toolkit integration
|
||||
- Hardware acceleration
|
||||
- Power management
|
||||
|
||||
**Features**:
|
||||
- Game-ready drivers
|
||||
- NVENC/NVDEC hardware encoding
|
||||
- CUDA development support
|
||||
- G-Sync compatibility
|
||||
- Optimus laptop support
|
||||
|
||||
**Special Considerations**:
|
||||
- Wayland compatibility configuration
|
||||
- Hybrid graphics laptop support
|
||||
- Multiple monitor setup
|
||||
- Custom kernel parameters
|
||||
|
||||
## Audio Hardware
|
||||
|
||||
### `audio.nix`
|
||||
**Purpose**: Audio system configuration and optimization
|
||||
**Audio Stack**: PipeWire with ALSA/PulseAudio compatibility
|
||||
|
||||
**What it configures**:
|
||||
- PipeWire audio server
|
||||
- Low-latency audio for content creation
|
||||
- Multiple audio device management
|
||||
- Bluetooth audio support
|
||||
|
||||
**Supported Hardware**:
|
||||
- Built-in laptop audio
|
||||
- USB audio interfaces
|
||||
- Professional audio equipment
|
||||
- Bluetooth headphones and speakers
|
||||
|
||||
**Features**:
|
||||
- Real-time audio processing
|
||||
- Multi-channel audio support
|
||||
- Audio routing and mixing
|
||||
- Professional audio plugin support
|
||||
|
||||
**Optimizations**:
|
||||
- Low-latency configuration
|
||||
- Buffer size optimization
|
||||
- Audio priority scheduling
|
||||
- Hardware-specific tweaks
|
||||
|
||||
## Input Devices
|
||||
|
||||
### `touchpad.nix`
|
||||
**Purpose**: Laptop touchpad configuration and gestures
|
||||
**What it configures**:
|
||||
- Touchpad sensitivity and acceleration
|
||||
- Multi-touch gesture support
|
||||
- Palm rejection
|
||||
- Scrolling behavior
|
||||
|
||||
**Gesture Support**:
|
||||
- Two-finger scrolling
|
||||
- Pinch-to-zoom
|
||||
- Three-finger swipe navigation
|
||||
- Four-finger workspace switching
|
||||
|
||||
**Customization Options**:
|
||||
- Sensitivity adjustment
|
||||
- Acceleration curves
|
||||
- Gesture threshold tuning
|
||||
- Disable-while-typing settings
|
||||
|
||||
## Connectivity
|
||||
|
||||
### `bluetooth.nix`
|
||||
**Purpose**: Bluetooth hardware and device management
|
||||
**What it configures**:
|
||||
- BlueZ Bluetooth stack
|
||||
- Device pairing and authentication
|
||||
- Audio codec support (A2DP, aptX)
|
||||
- Power management
|
||||
|
||||
**Supported Devices**:
|
||||
- Bluetooth headphones/speakers
|
||||
- Keyboards and mice
|
||||
- Game controllers
|
||||
- File transfer devices
|
||||
|
||||
**Features**:
|
||||
- Automatic device reconnection
|
||||
- Multiple device management
|
||||
- Profile switching
|
||||
- Battery level monitoring
|
||||
|
||||
## Hardware Detection Logic
|
||||
|
||||
### Automatic Detection
|
||||
The hardware system automatically detects:
|
||||
|
||||
```nix
|
||||
# GPU Detection
|
||||
gpu = if builtins.pathExists "/sys/class/drm/card0" then
|
||||
# Detect GPU vendor from driver information
|
||||
# Enable appropriate GPU module
|
||||
else null;
|
||||
|
||||
# Audio Detection
|
||||
audio = if config.sound.enable then
|
||||
# Configure audio hardware
|
||||
else null;
|
||||
```
|
||||
|
||||
### Manual Override
|
||||
Users can override automatic detection:
|
||||
|
||||
```nix
|
||||
# Force NVIDIA configuration even if not detected
|
||||
omnixy.hardware.nvidia.enable = true;
|
||||
omnixy.hardware.nvidia.prime = {
|
||||
enable = true;
|
||||
intelBusId = "PCI:0:2:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
};
|
||||
```
|
||||
|
||||
## Power Management
|
||||
|
||||
### Laptop Optimization
|
||||
- Battery life optimization
|
||||
- CPU frequency scaling
|
||||
- GPU power states
|
||||
- Display brightness control
|
||||
|
||||
### Desktop Performance
|
||||
- Maximum performance profiles
|
||||
- Gaming optimizations
|
||||
- Content creation acceleration
|
||||
- Thermal management
|
||||
|
||||
## Multi-GPU Systems
|
||||
|
||||
### Hybrid Graphics (Optimus/Prime)
|
||||
- Automatic GPU switching
|
||||
- Application-specific GPU assignment
|
||||
- Power saving when not gaming
|
||||
- External display routing
|
||||
|
||||
### Multi-GPU Rendering
|
||||
- SLI/CrossFire support where applicable
|
||||
- Compute workload distribution
|
||||
- Mining/AI acceleration setup
|
||||
|
||||
## Hardware-Specific Optimizations
|
||||
|
||||
### Gaming Configuration
|
||||
```nix
|
||||
omnixy.hardware.gaming = {
|
||||
enable = true;
|
||||
performance = "high";
|
||||
gpu = "nvidia"; # or "amd" or "intel"
|
||||
};
|
||||
```
|
||||
|
||||
### Content Creation
|
||||
```nix
|
||||
omnixy.hardware.creation = {
|
||||
enable = true;
|
||||
audio.lowLatency = true;
|
||||
gpu.acceleration = true;
|
||||
};
|
||||
```
|
||||
|
||||
### Development Workstation
|
||||
```nix
|
||||
omnixy.hardware.development = {
|
||||
enable = true;
|
||||
containers = true;
|
||||
virtualization = true;
|
||||
};
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Hardware Detection Issues
|
||||
- Check `lspci` output for hardware presence
|
||||
- Verify kernel module loading
|
||||
- Check hardware compatibility lists
|
||||
|
||||
### Driver Problems
|
||||
- Use hardware-specific logs
|
||||
- Check driver version compatibility
|
||||
- Verify configuration syntax
|
||||
|
||||
### Performance Issues
|
||||
- Monitor hardware utilization
|
||||
- Check thermal throttling
|
||||
- Verify power management settings
|
||||
|
||||
## Adding New Hardware Support
|
||||
|
||||
### Creating Hardware Modules
|
||||
|
||||
1. **Create Module File**:
|
||||
```nix
|
||||
# modules/hardware/my-hardware.nix
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.omnixy.hardware.myHardware;
|
||||
in {
|
||||
options.omnixy.hardware.myHardware = {
|
||||
enable = mkEnableOption "My Hardware support";
|
||||
# Additional options...
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Hardware configuration
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
2. **Add to Hardware Module**:
|
||||
```nix
|
||||
# In modules/hardware/default.nix
|
||||
imports = [
|
||||
# ... existing imports
|
||||
./my-hardware.nix
|
||||
];
|
||||
```
|
||||
|
||||
3. **Implement Detection**:
|
||||
```nix
|
||||
# Add automatic detection logic
|
||||
config.omnixy.hardware.myHardware.enable = mkDefault (
|
||||
# Detection logic here
|
||||
);
|
||||
```
|
||||
|
||||
### Hardware Module Guidelines
|
||||
- Use conditional configuration (`mkIf`)
|
||||
- Provide sensible defaults
|
||||
- Include performance optimizations
|
||||
- Document hardware requirements
|
||||
- Test on multiple hardware configurations
|
||||
|
||||
This comprehensive hardware support system ensures OmniXY works optimally across a wide variety of hardware configurations while providing easy customization for specific needs.
|
||||
@@ -18,14 +18,14 @@ with lib;
|
||||
nvtopPackages.amd
|
||||
];
|
||||
|
||||
# OpenGL packages for AMD
|
||||
hardware.opengl.extraPackages = with pkgs; [
|
||||
# Graphics packages for AMD
|
||||
hardware.graphics.extraPackages = with pkgs; [
|
||||
amdvlk
|
||||
rocm-opencl-icd
|
||||
rocm-opencl-runtime
|
||||
];
|
||||
|
||||
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [
|
||||
hardware.graphics.extraPackages32 = with pkgs.pkgsi686Linux; [
|
||||
driversi686Linux.amdvlk
|
||||
];
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ with lib;
|
||||
];
|
||||
|
||||
# Disable PulseAudio (conflicts with PipeWire)
|
||||
hardware.pulseaudio.enable = false;
|
||||
services.pulseaudio.enable = false;
|
||||
|
||||
# Audio group for user
|
||||
users.groups.audio = {};
|
||||
|
||||
@@ -21,15 +21,15 @@ with lib;
|
||||
nvtopPackages.intel
|
||||
];
|
||||
|
||||
# OpenGL packages for Intel (already configured in default.nix)
|
||||
hardware.opengl.extraPackages = with pkgs; [
|
||||
# Graphics packages for Intel (already configured in default.nix)
|
||||
hardware.graphics.extraPackages = with pkgs; [
|
||||
intel-media-driver
|
||||
vaapiIntel
|
||||
intel-compute-runtime
|
||||
intel-ocl
|
||||
];
|
||||
|
||||
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [
|
||||
hardware.graphics.extraPackages32 = with pkgs.pkgsi686Linux; [
|
||||
vaapiIntel
|
||||
];
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ with lib;
|
||||
nvtopPackages.nvidia
|
||||
];
|
||||
|
||||
# OpenGL packages for NVIDIA
|
||||
hardware.opengl.extraPackages = with pkgs; [
|
||||
# Graphics packages for NVIDIA
|
||||
hardware.graphics.extraPackages = with pkgs; [
|
||||
nvidia-vaapi-driver
|
||||
vaapiVdpau
|
||||
libvdpau-va-gl
|
||||
|
||||
@@ -7,7 +7,7 @@ with lib;
|
||||
|
||||
config = mkIf config.hardware.touchpad.enable {
|
||||
# Touchpad support via libinput
|
||||
services.xserver.libinput = {
|
||||
services.libinput = {
|
||||
enable = true;
|
||||
touchpad = {
|
||||
tapping = true;
|
||||
|
||||
@@ -498,32 +498,32 @@ in
|
||||
];
|
||||
|
||||
# Shell aliases for easy access
|
||||
omnixy.forUser {
|
||||
home-manager.users.${config.omnixy.user} = {
|
||||
programs.bash.shellAliases = {
|
||||
menu = "omnixy-menu";
|
||||
themes = "omnixy-theme-picker";
|
||||
rebuild = "omnixy-rebuild";
|
||||
update = "omnixy-update";
|
||||
rebuild = mkDefault "omnixy-rebuild";
|
||||
update = mkDefault "omnixy-update";
|
||||
info = "omnixy-info";
|
||||
clean = "omnixy-clean";
|
||||
clean = mkDefault "omnixy-clean";
|
||||
};
|
||||
|
||||
programs.zsh.shellAliases = {
|
||||
menu = "omnixy-menu";
|
||||
themes = "omnixy-theme-picker";
|
||||
rebuild = "omnixy-rebuild";
|
||||
update = "omnixy-update";
|
||||
rebuild = mkDefault "omnixy-rebuild";
|
||||
update = mkDefault "omnixy-update";
|
||||
info = "omnixy-info";
|
||||
clean = "omnixy-clean";
|
||||
clean = mkDefault "omnixy-clean";
|
||||
};
|
||||
|
||||
programs.fish.shellAliases = {
|
||||
menu = "omnixy-menu";
|
||||
themes = "omnixy-theme-picker";
|
||||
rebuild = "omnixy-rebuild";
|
||||
update = "omnixy-update";
|
||||
rebuild = mkDefault "omnixy-rebuild";
|
||||
update = mkDefault "omnixy-update";
|
||||
info = "omnixy-info";
|
||||
clean = "omnixy-clean";
|
||||
clean = mkDefault "omnixy-clean";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -127,7 +127,7 @@ in
|
||||
# Development packages
|
||||
++ optionals cfg.packages.categories.development [
|
||||
# Editors and IDEs
|
||||
neovim
|
||||
# neovim (configured via home-manager programs.neovim)
|
||||
emacs
|
||||
vscode
|
||||
jetbrains.idea-community
|
||||
|
||||
@@ -17,6 +17,295 @@ let
|
||||
hasFido2Device = ''
|
||||
${pkgs.libfido2}/bin/fido2-token -L 2>/dev/null | grep -q "dev:"
|
||||
'';
|
||||
|
||||
# Security management scripts
|
||||
securityScripts = [
|
||||
# Fingerprint management
|
||||
(omnixy.makeScript "omnixy-fingerprint" "Manage fingerprint authentication" ''
|
||||
case "$1" in
|
||||
"setup"|"enroll")
|
||||
echo "🔐 OmniXY Fingerprint Setup"
|
||||
echo "═══════════════════════════"
|
||||
|
||||
# Check for fingerprint hardware
|
||||
if ! (${hasFingerprintReader}); then
|
||||
echo "❌ No fingerprint reader detected!"
|
||||
echo " Supported devices: Synaptics, Goodix, Elan, Validity sensors"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Fingerprint reader detected"
|
||||
|
||||
# Check if fprintd service is running
|
||||
if ! systemctl is-active fprintd >/dev/null 2>&1; then
|
||||
echo "🔄 Starting fingerprint service..."
|
||||
sudo systemctl start fprintd
|
||||
fi
|
||||
|
||||
echo "👆 Please follow the prompts to enroll your fingerprint"
|
||||
echo " You'll need to scan your finger multiple times"
|
||||
echo
|
||||
|
||||
# Enroll fingerprint
|
||||
${pkgs.fprintd}/bin/fprintd-enroll "$USER"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo
|
||||
echo "✅ Fingerprint enrolled successfully!"
|
||||
echo "💡 You can now use your fingerprint for:"
|
||||
echo " - sudo commands"
|
||||
echo " - System authentication dialogs"
|
||||
echo " - Screen unlock (if supported)"
|
||||
else
|
||||
echo "❌ Fingerprint enrollment failed"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
"test"|"verify")
|
||||
echo "🔐 Testing fingerprint authentication..."
|
||||
|
||||
if ! (${hasFingerprintReader}); then
|
||||
echo "❌ No fingerprint reader detected!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "👆 Please scan your enrolled finger"
|
||||
${pkgs.fprintd}/bin/fprintd-verify "$USER"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ Fingerprint verification successful!"
|
||||
else
|
||||
echo "❌ Fingerprint verification failed"
|
||||
echo "💡 Try: omnixy-fingerprint setup"
|
||||
fi
|
||||
;;
|
||||
|
||||
"remove"|"delete")
|
||||
echo "🗑️ Removing fingerprint data..."
|
||||
${pkgs.fprintd}/bin/fprintd-delete "$USER"
|
||||
echo "✅ Fingerprint data removed"
|
||||
;;
|
||||
|
||||
"list")
|
||||
echo "📋 Enrolled fingerprints:"
|
||||
${pkgs.fprintd}/bin/fprintd-list "$USER" 2>/dev/null || echo " No fingerprints enrolled"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "🔐 OmniXY Fingerprint Management"
|
||||
echo
|
||||
echo "Usage: omnixy-fingerprint <command>"
|
||||
echo
|
||||
echo "Commands:"
|
||||
echo " setup, enroll - Enroll a new fingerprint"
|
||||
echo " test, verify - Test fingerprint authentication"
|
||||
echo " remove, delete - Remove enrolled fingerprints"
|
||||
echo " list - List enrolled fingerprints"
|
||||
echo
|
||||
|
||||
# Show hardware status
|
||||
if (${hasFingerprintReader}); then
|
||||
echo "Hardware: ✅ Fingerprint reader detected"
|
||||
else
|
||||
echo "Hardware: ❌ No fingerprint reader found"
|
||||
fi
|
||||
|
||||
# Show service status
|
||||
if systemctl is-active fprintd >/dev/null 2>&1; then
|
||||
echo "Service: ✅ fprintd running"
|
||||
else
|
||||
echo "Service: ❌ fprintd not running"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
'')
|
||||
|
||||
# FIDO2 management
|
||||
(omnixy.makeScript "omnixy-fido2" "Manage FIDO2/WebAuthn authentication" ''
|
||||
case "$1" in
|
||||
"setup"|"register")
|
||||
echo "🔑 OmniXY FIDO2 Setup"
|
||||
echo "═══════════════════"
|
||||
|
||||
# Check for FIDO2 hardware
|
||||
if ! (${hasFido2Device}); then
|
||||
echo "❌ No FIDO2 device detected!"
|
||||
echo " Please insert a FIDO2 security key (YubiKey, etc.)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ FIDO2 device detected:"
|
||||
${pkgs.libfido2}/bin/fido2-token -L
|
||||
echo
|
||||
|
||||
# Register device
|
||||
echo "🔑 Please touch your security key when prompted..."
|
||||
output=$(${pkgs.pam_u2f}/bin/pamu2fcfg -u "$USER")
|
||||
|
||||
if [ $? -eq 0 ] && [ -n "$output" ]; then
|
||||
# Save to system configuration
|
||||
echo "$output" | sudo tee -a /etc/fido2/fido2 >/dev/null
|
||||
|
||||
echo "✅ FIDO2 device registered successfully!"
|
||||
echo "💡 You can now use your security key for:"
|
||||
echo " - sudo commands"
|
||||
echo " - System authentication dialogs"
|
||||
echo " - Screen unlock"
|
||||
else
|
||||
echo "❌ FIDO2 device registration failed"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
"test")
|
||||
echo "🔑 Testing FIDO2 authentication..."
|
||||
|
||||
if [ ! -s /etc/fido2/fido2 ]; then
|
||||
echo "❌ No FIDO2 devices registered"
|
||||
echo "💡 Try: omnixy-fido2 setup"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "🔑 Please touch your security key..."
|
||||
# Test by trying to authenticate with PAM
|
||||
echo "Authentication test complete"
|
||||
;;
|
||||
|
||||
"list")
|
||||
echo "📋 Registered FIDO2 devices:"
|
||||
if [ -f /etc/fido2/fido2 ]; then
|
||||
cat /etc/fido2/fido2 | while read -r line; do
|
||||
if [ -n "$line" ]; then
|
||||
echo " Device: ''${line%%:*}"
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo " No devices registered"
|
||||
fi
|
||||
;;
|
||||
|
||||
"remove")
|
||||
echo "🗑️ Removing FIDO2 configuration..."
|
||||
sudo rm -f /etc/fido2/fido2
|
||||
sudo touch /etc/fido2/fido2
|
||||
echo "✅ All FIDO2 devices removed"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "🔑 OmniXY FIDO2 Management"
|
||||
echo
|
||||
echo "Usage: omnixy-fido2 <command>"
|
||||
echo
|
||||
echo "Commands:"
|
||||
echo " setup, register - Register a new FIDO2 device"
|
||||
echo " test - Test FIDO2 authentication"
|
||||
echo " list - List registered devices"
|
||||
echo " remove - Remove all registered devices"
|
||||
echo
|
||||
|
||||
# Show hardware status
|
||||
if (${hasFido2Device}); then
|
||||
echo "Hardware: ✅ FIDO2 device detected"
|
||||
else
|
||||
echo "Hardware: ❌ No FIDO2 device found"
|
||||
fi
|
||||
|
||||
# Show configuration status
|
||||
if [ -s /etc/fido2/fido2 ]; then
|
||||
echo "Config: ✅ Devices registered"
|
||||
else
|
||||
echo "Config: ❌ No devices registered"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
'')
|
||||
|
||||
# Security status and management
|
||||
(omnixy.makeScript "omnixy-security" "Security status and management" ''
|
||||
case "$1" in
|
||||
"status")
|
||||
echo "🔒 OmniXY Security Status"
|
||||
echo "═══════════════════════"
|
||||
echo
|
||||
|
||||
# Hardware detection
|
||||
echo "🔧 Hardware:"
|
||||
if (${hasFingerprintReader}); then
|
||||
echo " ✅ Fingerprint reader detected"
|
||||
else
|
||||
echo " ❌ No fingerprint reader"
|
||||
fi
|
||||
|
||||
if (${hasFido2Device}); then
|
||||
echo " ✅ FIDO2 device detected"
|
||||
else
|
||||
echo " ❌ No FIDO2 device"
|
||||
fi
|
||||
echo
|
||||
|
||||
# Services
|
||||
echo "🛡️ Services:"
|
||||
printf " fprintd: "
|
||||
if systemctl is-active fprintd >/dev/null 2>&1; then
|
||||
echo "✅ running"
|
||||
else
|
||||
echo "❌ stopped"
|
||||
fi
|
||||
|
||||
printf " firewall: "
|
||||
if systemctl is-active ufw >/dev/null 2>&1; then
|
||||
echo "✅ active"
|
||||
else
|
||||
echo "❌ inactive"
|
||||
fi
|
||||
echo
|
||||
|
||||
# Configuration
|
||||
echo "⚙️ Configuration:"
|
||||
if [ -s /etc/fido2/fido2 ]; then
|
||||
device_count=$(wc -l < /etc/fido2/fido2)
|
||||
echo " FIDO2: ✅ $device_count device(s) registered"
|
||||
else
|
||||
echo " FIDO2: ❌ no devices registered"
|
||||
fi
|
||||
|
||||
fingerprint_count=$(${pkgs.fprintd}/bin/fprintd-list "$USER" 2>/dev/null | wc -l || echo "0")
|
||||
if [ "$fingerprint_count" -gt 0 ]; then
|
||||
echo " Fingerprint: ✅ enrolled"
|
||||
else
|
||||
echo " Fingerprint: ❌ not enrolled"
|
||||
fi
|
||||
;;
|
||||
|
||||
"reset-lockout")
|
||||
echo "🔓 Resetting account lockout..."
|
||||
sudo ${pkgs.util-linux}/bin/faillock --user "$USER" --reset
|
||||
echo "✅ Account lockout reset"
|
||||
;;
|
||||
|
||||
"firewall")
|
||||
echo "🛡️ Firewall status:"
|
||||
sudo ufw status verbose
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "🔒 OmniXY Security Management"
|
||||
echo
|
||||
echo "Usage: omnixy-security <command>"
|
||||
echo
|
||||
echo "Commands:"
|
||||
echo " status - Show security status"
|
||||
echo " reset-lockout - Reset failed login attempts"
|
||||
echo " firewall - Show firewall status"
|
||||
echo
|
||||
echo "Related commands:"
|
||||
echo " omnixy-fingerprint - Manage fingerprint authentication"
|
||||
echo " omnixy-fido2 - Manage FIDO2 authentication"
|
||||
;;
|
||||
esac
|
||||
'')
|
||||
];
|
||||
in
|
||||
{
|
||||
options.omnixy.security = {
|
||||
@@ -68,8 +357,8 @@ in
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable or true) {
|
||||
# Security packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Security packages and management scripts (consolidated)
|
||||
environment.systemPackages = (with pkgs; [
|
||||
# Fingerprint authentication
|
||||
fprintd
|
||||
|
||||
@@ -80,10 +369,9 @@ in
|
||||
# Security utilities
|
||||
usbutils
|
||||
pciutils
|
||||
|
||||
# Firewall management
|
||||
ufw
|
||||
];
|
||||
]) ++ [
|
||||
# Security management scripts defined below
|
||||
] ++ securityScripts;
|
||||
|
||||
# Fingerprint authentication configuration
|
||||
services.fprintd = mkIf (cfg.fingerprint.enable or cfg.fingerprint.autoDetect) {
|
||||
@@ -91,72 +379,19 @@ in
|
||||
package = pkgs.fprintd;
|
||||
};
|
||||
|
||||
# PAM configuration for fingerprint
|
||||
security.pam.services = mkIf (cfg.fingerprint.enable or cfg.fingerprint.autoDetect) {
|
||||
# Enable fingerprint for sudo
|
||||
sudo.fprintAuth = true;
|
||||
# Security configuration (consolidated)
|
||||
security = {
|
||||
# Sudo security configuration
|
||||
sudo = mkMerge [
|
||||
(mkIf cfg.systemHardening.enable {
|
||||
enable = true;
|
||||
wheelNeedsPassword = true;
|
||||
execWheelOnly = true;
|
||||
})
|
||||
];
|
||||
|
||||
# Enable fingerprint for polkit (system authentication)
|
||||
polkit-1 = {
|
||||
fprintAuth = true;
|
||||
text = ''
|
||||
auth sufficient pam_fprintd.so
|
||||
auth include system-auth
|
||||
account include system-auth
|
||||
password include system-auth
|
||||
session include system-auth
|
||||
'';
|
||||
};
|
||||
|
||||
# Enable for login if using display manager
|
||||
login.fprintAuth = mkDefault true;
|
||||
|
||||
# Enable for screen lock
|
||||
hyprlock = mkIf (config.omnixy.desktop.enable or false) {
|
||||
fprintAuth = true;
|
||||
text = ''
|
||||
auth sufficient pam_fprintd.so
|
||||
auth include system-auth
|
||||
account include system-auth
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
# FIDO2 authentication configuration
|
||||
security.pam.services = mkIf (cfg.fido2.enable) {
|
||||
# FIDO2 for sudo
|
||||
sudo = {
|
||||
text = mkBefore ''
|
||||
auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2
|
||||
'';
|
||||
};
|
||||
|
||||
# FIDO2 for polkit
|
||||
polkit-1 = {
|
||||
text = mkBefore ''
|
||||
auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2
|
||||
'';
|
||||
};
|
||||
|
||||
# FIDO2 for screen lock
|
||||
hyprlock = mkIf (config.omnixy.desktop.enable or false) {
|
||||
text = mkBefore ''
|
||||
auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
# System hardening configuration
|
||||
security = mkIf cfg.systemHardening.enable {
|
||||
# Sudo security
|
||||
sudo = {
|
||||
enable = true;
|
||||
wheelNeedsPassword = true;
|
||||
execWheelOnly = true;
|
||||
};
|
||||
|
||||
# Polkit security
|
||||
polkit = {
|
||||
# Polkit security configuration
|
||||
polkit = mkIf cfg.systemHardening.enable {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
polkit.addRule(function(action, subject) {
|
||||
@@ -169,37 +404,90 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
# Account lockout protection
|
||||
pam.loginLimits = mkIf cfg.systemHardening.faillock.enable [
|
||||
{
|
||||
domain = "*";
|
||||
type = "hard";
|
||||
item = "core";
|
||||
value = "0";
|
||||
}
|
||||
];
|
||||
};
|
||||
# PAM configuration for authentication methods
|
||||
pam = {
|
||||
# Login limits for account lockout protection
|
||||
loginLimits = mkIf cfg.systemHardening.faillock.enable [
|
||||
{
|
||||
domain = "*";
|
||||
type = "hard";
|
||||
item = "core";
|
||||
value = "0";
|
||||
}
|
||||
];
|
||||
|
||||
# Faillock configuration
|
||||
security.pam.services.system-auth = mkIf cfg.systemHardening.faillock.enable {
|
||||
text = mkAfter ''
|
||||
auth required pam_faillock.so preauth
|
||||
auth required pam_faillock.so authfail deny=${toString cfg.systemHardening.faillock.denyAttempts} unlock_time=${toString cfg.systemHardening.faillock.unlockTime}
|
||||
account required pam_faillock.so
|
||||
'';
|
||||
# PAM services configuration
|
||||
services = {
|
||||
# Sudo configuration
|
||||
sudo = mkMerge [
|
||||
(mkIf (cfg.fingerprint.enable or cfg.fingerprint.autoDetect) {
|
||||
fprintAuth = true;
|
||||
})
|
||||
(mkIf cfg.fido2.enable {
|
||||
text = mkBefore ''
|
||||
auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2
|
||||
'';
|
||||
})
|
||||
];
|
||||
|
||||
# Polkit configuration
|
||||
polkit-1 = mkMerge [
|
||||
(mkIf (cfg.fingerprint.enable or cfg.fingerprint.autoDetect) {
|
||||
fprintAuth = true;
|
||||
text = ''
|
||||
auth sufficient pam_fprintd.so
|
||||
auth include system-auth
|
||||
account include system-auth
|
||||
password include system-auth
|
||||
session include system-auth
|
||||
'';
|
||||
})
|
||||
(mkIf cfg.fido2.enable {
|
||||
text = mkBefore ''
|
||||
auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2
|
||||
'';
|
||||
})
|
||||
];
|
||||
|
||||
# Login configuration
|
||||
login = mkIf (cfg.fingerprint.enable or cfg.fingerprint.autoDetect) {
|
||||
fprintAuth = mkDefault true;
|
||||
};
|
||||
|
||||
# Screen lock configuration
|
||||
hyprlock = mkIf (config.omnixy.desktop.enable or false) (mkMerge [
|
||||
(mkIf (cfg.fingerprint.enable or cfg.fingerprint.autoDetect) {
|
||||
fprintAuth = true;
|
||||
text = ''
|
||||
auth sufficient pam_fprintd.so
|
||||
auth include system-auth
|
||||
account include system-auth
|
||||
'';
|
||||
})
|
||||
(mkIf cfg.fido2.enable {
|
||||
text = mkBefore ''
|
||||
auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2
|
||||
'';
|
||||
})
|
||||
]);
|
||||
|
||||
# Faillock configuration for system-auth
|
||||
system-auth = mkIf cfg.systemHardening.faillock.enable {
|
||||
text = mkAfter ''
|
||||
auth required pam_faillock.so preauth
|
||||
auth required pam_faillock.so authfail deny=${toString cfg.systemHardening.faillock.denyAttempts} unlock_time=${toString cfg.systemHardening.faillock.unlockTime}
|
||||
account required pam_faillock.so
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Firewall configuration
|
||||
networking.firewall = mkIf cfg.systemHardening.enable {
|
||||
enable = true;
|
||||
|
||||
# Default deny incoming, allow outgoing
|
||||
defaultPolicy = {
|
||||
default = "deny";
|
||||
defaultOutput = "allow";
|
||||
};
|
||||
|
||||
# Essential services
|
||||
# Essential services (NixOS firewall denies by default)
|
||||
allowedTCPPorts = [ 22 ]; # SSH
|
||||
allowedUDPPorts = [ 53317 ]; # LocalSend
|
||||
allowedTCPPortRanges = [
|
||||
@@ -219,297 +507,10 @@ in
|
||||
fi
|
||||
'';
|
||||
|
||||
# Security management scripts
|
||||
environment.systemPackages = [
|
||||
# Fingerprint management
|
||||
(omnixy.makeScript "omnixy-fingerprint" "Manage fingerprint authentication" ''
|
||||
case "$1" in
|
||||
"setup"|"enroll")
|
||||
echo "🔐 OmniXY Fingerprint Setup"
|
||||
echo "═══════════════════════════"
|
||||
|
||||
# Check for fingerprint hardware
|
||||
if ! ${hasFingerprintReader}; then
|
||||
echo "❌ No fingerprint reader detected!"
|
||||
echo " Supported devices: Synaptics, Goodix, Elan, Validity sensors"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Fingerprint reader detected"
|
||||
|
||||
# Check if fprintd service is running
|
||||
if ! systemctl is-active fprintd >/dev/null 2>&1; then
|
||||
echo "🔄 Starting fingerprint service..."
|
||||
sudo systemctl start fprintd
|
||||
fi
|
||||
|
||||
echo "👆 Please follow the prompts to enroll your fingerprint"
|
||||
echo " You'll need to scan your finger multiple times"
|
||||
echo
|
||||
|
||||
# Enroll fingerprint
|
||||
${pkgs.fprintd}/bin/fprintd-enroll "$USER"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo
|
||||
echo "✅ Fingerprint enrolled successfully!"
|
||||
echo "💡 You can now use your fingerprint for:"
|
||||
echo " - sudo commands"
|
||||
echo " - System authentication dialogs"
|
||||
echo " - Screen unlock (if supported)"
|
||||
else
|
||||
echo "❌ Fingerprint enrollment failed"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
"test"|"verify")
|
||||
echo "🔐 Testing fingerprint authentication..."
|
||||
|
||||
if ! ${hasFingerprintReader}; then
|
||||
echo "❌ No fingerprint reader detected!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "👆 Please scan your enrolled finger"
|
||||
${pkgs.fprintd}/bin/fprintd-verify "$USER"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ Fingerprint verification successful!"
|
||||
else
|
||||
echo "❌ Fingerprint verification failed"
|
||||
echo "💡 Try: omnixy-fingerprint setup"
|
||||
fi
|
||||
;;
|
||||
|
||||
"remove"|"delete")
|
||||
echo "🗑️ Removing fingerprint data..."
|
||||
${pkgs.fprintd}/bin/fprintd-delete "$USER"
|
||||
echo "✅ Fingerprint data removed"
|
||||
;;
|
||||
|
||||
"list")
|
||||
echo "📋 Enrolled fingerprints:"
|
||||
${pkgs.fprintd}/bin/fprintd-list "$USER" 2>/dev/null || echo " No fingerprints enrolled"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "🔐 OmniXY Fingerprint Management"
|
||||
echo
|
||||
echo "Usage: omnixy-fingerprint <command>"
|
||||
echo
|
||||
echo "Commands:"
|
||||
echo " setup, enroll - Enroll a new fingerprint"
|
||||
echo " test, verify - Test fingerprint authentication"
|
||||
echo " remove, delete - Remove enrolled fingerprints"
|
||||
echo " list - List enrolled fingerprints"
|
||||
echo
|
||||
|
||||
# Show hardware status
|
||||
if ${hasFingerprintReader}; then
|
||||
echo "Hardware: ✅ Fingerprint reader detected"
|
||||
else
|
||||
echo "Hardware: ❌ No fingerprint reader found"
|
||||
fi
|
||||
|
||||
# Show service status
|
||||
if systemctl is-active fprintd >/dev/null 2>&1; then
|
||||
echo "Service: ✅ fprintd running"
|
||||
else
|
||||
echo "Service: ❌ fprintd not running"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
'')
|
||||
|
||||
# FIDO2 management
|
||||
(omnixy.makeScript "omnixy-fido2" "Manage FIDO2/WebAuthn authentication" ''
|
||||
case "$1" in
|
||||
"setup"|"register")
|
||||
echo "🔑 OmniXY FIDO2 Setup"
|
||||
echo "═══════════════════"
|
||||
|
||||
# Check for FIDO2 hardware
|
||||
if ! ${hasFido2Device}; then
|
||||
echo "❌ No FIDO2 device detected!"
|
||||
echo " Please insert a FIDO2 security key (YubiKey, etc.)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ FIDO2 device detected:"
|
||||
${pkgs.libfido2}/bin/fido2-token -L
|
||||
echo
|
||||
|
||||
# Register device
|
||||
echo "🔑 Please touch your security key when prompted..."
|
||||
output=$(${pkgs.pam_u2f}/bin/pamu2fcfg -u "$USER")
|
||||
|
||||
if [ $? -eq 0 ] && [ -n "$output" ]; then
|
||||
# Save to system configuration
|
||||
echo "$output" | sudo tee -a /etc/fido2/fido2 >/dev/null
|
||||
|
||||
echo "✅ FIDO2 device registered successfully!"
|
||||
echo "💡 You can now use your security key for:"
|
||||
echo " - sudo commands"
|
||||
echo " - System authentication dialogs"
|
||||
echo " - Screen unlock"
|
||||
else
|
||||
echo "❌ FIDO2 device registration failed"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
"test")
|
||||
echo "🔑 Testing FIDO2 authentication..."
|
||||
|
||||
if [ ! -s /etc/fido2/fido2 ]; then
|
||||
echo "❌ No FIDO2 devices registered"
|
||||
echo "💡 Try: omnixy-fido2 setup"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "🔑 Please touch your security key..."
|
||||
# Test by trying to authenticate with PAM
|
||||
echo "Authentication test complete"
|
||||
;;
|
||||
|
||||
"list")
|
||||
echo "📋 Registered FIDO2 devices:"
|
||||
if [ -f /etc/fido2/fido2 ]; then
|
||||
cat /etc/fido2/fido2 | while read -r line; do
|
||||
if [ -n "$line" ]; then
|
||||
echo " Device: ''${line%%:*}"
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo " No devices registered"
|
||||
fi
|
||||
;;
|
||||
|
||||
"remove")
|
||||
echo "🗑️ Removing FIDO2 configuration..."
|
||||
sudo rm -f /etc/fido2/fido2
|
||||
sudo touch /etc/fido2/fido2
|
||||
echo "✅ All FIDO2 devices removed"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "🔑 OmniXY FIDO2 Management"
|
||||
echo
|
||||
echo "Usage: omnixy-fido2 <command>"
|
||||
echo
|
||||
echo "Commands:"
|
||||
echo " setup, register - Register a new FIDO2 device"
|
||||
echo " test - Test FIDO2 authentication"
|
||||
echo " list - List registered devices"
|
||||
echo " remove - Remove all registered devices"
|
||||
echo
|
||||
|
||||
# Show hardware status
|
||||
if ${hasFido2Device}; then
|
||||
echo "Hardware: ✅ FIDO2 device detected"
|
||||
else
|
||||
echo "Hardware: ❌ No FIDO2 device found"
|
||||
fi
|
||||
|
||||
# Show configuration status
|
||||
if [ -s /etc/fido2/fido2 ]; then
|
||||
echo "Config: ✅ Devices registered"
|
||||
else
|
||||
echo "Config: ❌ No devices registered"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
'')
|
||||
|
||||
# Security status and management
|
||||
(omnixy.makeScript "omnixy-security" "Security status and management" ''
|
||||
case "$1" in
|
||||
"status")
|
||||
echo "🔒 OmniXY Security Status"
|
||||
echo "═══════════════════════"
|
||||
echo
|
||||
|
||||
# Hardware detection
|
||||
echo "🔧 Hardware:"
|
||||
if ${hasFingerprintReader}; then
|
||||
echo " ✅ Fingerprint reader detected"
|
||||
else
|
||||
echo " ❌ No fingerprint reader"
|
||||
fi
|
||||
|
||||
if ${hasFido2Device}; then
|
||||
echo " ✅ FIDO2 device detected"
|
||||
else
|
||||
echo " ❌ No FIDO2 device"
|
||||
fi
|
||||
echo
|
||||
|
||||
# Services
|
||||
echo "🛡️ Services:"
|
||||
printf " fprintd: "
|
||||
if systemctl is-active fprintd >/dev/null 2>&1; then
|
||||
echo "✅ running"
|
||||
else
|
||||
echo "❌ stopped"
|
||||
fi
|
||||
|
||||
printf " firewall: "
|
||||
if systemctl is-active ufw >/dev/null 2>&1; then
|
||||
echo "✅ active"
|
||||
else
|
||||
echo "❌ inactive"
|
||||
fi
|
||||
echo
|
||||
|
||||
# Configuration
|
||||
echo "⚙️ Configuration:"
|
||||
if [ -s /etc/fido2/fido2 ]; then
|
||||
device_count=$(wc -l < /etc/fido2/fido2)
|
||||
echo " FIDO2: ✅ $device_count device(s) registered"
|
||||
else
|
||||
echo " FIDO2: ❌ no devices registered"
|
||||
fi
|
||||
|
||||
fingerprint_count=$(${pkgs.fprintd}/bin/fprintd-list "$USER" 2>/dev/null | wc -l || echo "0")
|
||||
if [ "$fingerprint_count" -gt 0 ]; then
|
||||
echo " Fingerprint: ✅ enrolled"
|
||||
else
|
||||
echo " Fingerprint: ❌ not enrolled"
|
||||
fi
|
||||
;;
|
||||
|
||||
"reset-lockout")
|
||||
echo "🔓 Resetting account lockout..."
|
||||
sudo ${pkgs.util-linux}/bin/faillock --user "$USER" --reset
|
||||
echo "✅ Account lockout reset"
|
||||
;;
|
||||
|
||||
"firewall")
|
||||
echo "🛡️ Firewall status:"
|
||||
sudo ufw status verbose
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "🔒 OmniXY Security Management"
|
||||
echo
|
||||
echo "Usage: omnixy-security <command>"
|
||||
echo
|
||||
echo "Commands:"
|
||||
echo " status - Show security status"
|
||||
echo " reset-lockout - Reset failed login attempts"
|
||||
echo " firewall - Show firewall status"
|
||||
echo
|
||||
echo "Related commands:"
|
||||
echo " omnixy-fingerprint - Manage fingerprint authentication"
|
||||
echo " omnixy-fido2 - Manage FIDO2 authentication"
|
||||
;;
|
||||
esac
|
||||
'')
|
||||
];
|
||||
# Security management scripts are now defined in the let block above
|
||||
|
||||
# Add to main menu integration
|
||||
omnixy.forUser {
|
||||
home-manager.users.${config.omnixy.user} = {
|
||||
programs.bash.shellAliases = {
|
||||
fingerprint = "omnixy-fingerprint";
|
||||
fido2 = "omnixy-fido2";
|
||||
|
||||
@@ -29,17 +29,10 @@ in
|
||||
enable = true;
|
||||
|
||||
# Display Manager disabled - using greetd instead
|
||||
displayManager.gdm.enable = false;
|
||||
# (moved to services.displayManager.gdm.enable)
|
||||
|
||||
# Touchpad support
|
||||
libinput = {
|
||||
enable = true;
|
||||
touchpad = {
|
||||
naturalScrolling = true;
|
||||
tapping = true;
|
||||
clickMethod = "clickfinger";
|
||||
};
|
||||
};
|
||||
# Touchpad support (moved to services.libinput)
|
||||
# libinput configuration moved to services.libinput
|
||||
|
||||
# Keyboard layout
|
||||
xkb = {
|
||||
@@ -49,6 +42,19 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
# Display Manager (disabled - using greetd instead)
|
||||
displayManager.gdm.enable = false;
|
||||
|
||||
# Touchpad support
|
||||
libinput = {
|
||||
enable = true;
|
||||
touchpad = {
|
||||
naturalScrolling = true;
|
||||
tapping = true;
|
||||
clickMethod = "clickfinger";
|
||||
};
|
||||
};
|
||||
|
||||
# Printing support
|
||||
printing = {
|
||||
enable = true;
|
||||
|
||||
308
modules/themes/README.md
Normal file
308
modules/themes/README.md
Normal file
@@ -0,0 +1,308 @@
|
||||
# Themes Directory - OmniXY Theme System
|
||||
|
||||
The `modules/themes/` directory contains complete theme definitions that provide unified styling across all applications and desktop components in OmniXY. Each theme is a self-contained Nix module that configures colors, fonts, and appearance settings system-wide.
|
||||
|
||||
## Theme Architecture
|
||||
|
||||
Each theme module follows this structure:
|
||||
```nix
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
# Color palette definitions
|
||||
colors = {
|
||||
primary = "#7aa2f7";
|
||||
background = "#1a1b26";
|
||||
# ... more colors
|
||||
};
|
||||
in {
|
||||
# Theme configuration for all applications
|
||||
config = lib.mkIf (config.omnixy.theme == "theme-name") {
|
||||
# Application configurations
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## Available Themes
|
||||
|
||||
OmniXY includes 11 carefully crafted themes:
|
||||
|
||||
### Dark Themes
|
||||
|
||||
#### `tokyo-night.nix` (Default)
|
||||
**Inspiration**: Tokyo's neon-lit nights
|
||||
**Palette**: Deep blues and vibrant accents
|
||||
**Character**: Modern, clean, high contrast
|
||||
**Best for**: Programming, late-night work
|
||||
|
||||
**Key Colors**:
|
||||
- Background: `#1a1b26` (Dark navy)
|
||||
- Primary: `#7aa2f7` (Bright blue)
|
||||
- Accent: `#bb9af7` (Purple)
|
||||
- Success: `#9ece6a` (Green)
|
||||
- Warning: `#e0af68` (Orange)
|
||||
|
||||
#### `catppuccin.nix`
|
||||
**Inspiration**: Warm, cozy coffee shop
|
||||
**Palette**: Soft pastels with warm undertones
|
||||
**Character**: Soothing, gentle on eyes
|
||||
**Best for**: Long coding sessions, reading
|
||||
|
||||
**Key Colors**:
|
||||
- Background: `#1e1e2e` (Warm dark)
|
||||
- Primary: `#cba6f7` (Soft purple)
|
||||
- Accent: `#f38ba8` (Rose)
|
||||
- Success: `#a6e3a1` (Mint green)
|
||||
|
||||
#### `gruvbox.nix`
|
||||
**Inspiration**: Retro terminal aesthetics
|
||||
**Palette**: Warm earth tones
|
||||
**Character**: Vintage, comfortable, nostalgic
|
||||
**Best for**: Terminal work, distraction-free coding
|
||||
|
||||
#### `nord.nix`
|
||||
**Inspiration**: Arctic, Scandinavian minimalism
|
||||
**Palette**: Cool blues and grays
|
||||
**Character**: Clean, minimal, professional
|
||||
**Best for**: Focus work, professional environments
|
||||
|
||||
#### `everforest.nix`
|
||||
**Inspiration**: Deep forest, natural greens
|
||||
**Palette**: Forest greens with earth accents
|
||||
**Character**: Calm, natural, easy on eyes
|
||||
**Best for**: Long work sessions, nature lovers
|
||||
|
||||
#### `rose-pine.nix`
|
||||
**Inspiration**: English countryside
|
||||
**Palette**: Muted roses and soft pinks
|
||||
**Character**: Elegant, sophisticated, gentle
|
||||
**Best for**: Creative work, design
|
||||
|
||||
#### `kanagawa.nix`
|
||||
**Inspiration**: Japanese woodblock prints
|
||||
**Palette**: Traditional Japanese colors
|
||||
**Character**: Artistic, cultural, balanced
|
||||
**Best for**: Creative coding, artistic work
|
||||
|
||||
#### `matte-black.nix`
|
||||
**Inspiration**: Minimalist design
|
||||
**Palette**: True blacks and whites
|
||||
**Character**: Stark, minimal, high contrast
|
||||
**Best for**: Focus, minimal distractions
|
||||
|
||||
#### `osaka-jade.nix`
|
||||
**Inspiration**: Japanese jade and bamboo
|
||||
**Palette**: Jade greens with natural accents
|
||||
**Character**: Serene, balanced, harmonious
|
||||
**Best for**: Meditation coding, calm work
|
||||
|
||||
#### `ristretto.nix`
|
||||
**Inspiration**: Dark roasted coffee
|
||||
**Palette**: Rich browns and warm tones
|
||||
**Character**: Warm, cozy, comfortable
|
||||
**Best for**: Coffee shop coding, warm environments
|
||||
|
||||
### Light Theme
|
||||
|
||||
#### `catppuccin-latte.nix`
|
||||
**Inspiration**: Light coffee, morning work
|
||||
**Palette**: Soft pastels on light background
|
||||
**Character**: Bright, energetic, clean
|
||||
**Best for**: Daytime work, bright environments
|
||||
|
||||
## Theme Components
|
||||
|
||||
Each theme configures these application categories:
|
||||
|
||||
### Terminal Applications
|
||||
- **Alacritty**: Terminal colors and transparency
|
||||
- **Kitty**: Color scheme and font rendering
|
||||
- **Shell**: Prompt colors and syntax highlighting
|
||||
|
||||
### Text Editors
|
||||
- **Neovim**: Syntax highlighting and UI colors
|
||||
- **VSCode**: Editor theme and syntax colors
|
||||
- **Terminal editors**: Vim, nano color schemes
|
||||
|
||||
### Desktop Environment
|
||||
- **Hyprland**: Window borders, gaps, animations
|
||||
- **Waybar**: Panel colors, module styling
|
||||
- **Rofi/Launchers**: Menu and selection colors
|
||||
|
||||
### System UI
|
||||
- **GTK**: System-wide GTK application theming
|
||||
- **Qt**: Qt application color schemes
|
||||
- **Icon themes**: Matching icon sets
|
||||
|
||||
### Notification System
|
||||
- **Mako**: Notification colors and styling
|
||||
- **System notifications**: Alert and info colors
|
||||
|
||||
### Development Tools
|
||||
- **Git tools**: Diff colors, status indicators
|
||||
- **Lazygit**: TUI color scheme
|
||||
- **Development containers**: Terminal themes
|
||||
|
||||
## Theme Implementation
|
||||
|
||||
### Color Management
|
||||
Each theme defines a comprehensive color palette:
|
||||
|
||||
```nix
|
||||
colors = {
|
||||
# Base colors
|
||||
bg = "#1a1b26"; # Background
|
||||
fg = "#c0caf5"; # Foreground text
|
||||
|
||||
# Accent colors
|
||||
blue = "#7aa2f7"; # Primary blue
|
||||
cyan = "#7dcfff"; # Cyan accents
|
||||
green = "#9ece6a"; # Success/positive
|
||||
yellow = "#e0af68"; # Warnings
|
||||
red = "#f7768e"; # Errors/critical
|
||||
purple = "#bb9af7"; # Special/accent
|
||||
|
||||
# UI colors
|
||||
border = "#414868"; # Window borders
|
||||
selection = "#364a82"; # Text selection
|
||||
comment = "#565f89"; # Comments/inactive
|
||||
};
|
||||
```
|
||||
|
||||
### Application Configuration
|
||||
Colors are applied consistently across applications:
|
||||
|
||||
```nix
|
||||
# Alacritty terminal configuration
|
||||
programs.alacritty.settings = {
|
||||
colors = {
|
||||
primary = {
|
||||
background = colors.bg;
|
||||
foreground = colors.fg;
|
||||
};
|
||||
normal = {
|
||||
black = colors.bg;
|
||||
blue = colors.blue;
|
||||
# ... more colors
|
||||
};
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
### Dynamic Application
|
||||
Themes are applied conditionally:
|
||||
|
||||
```nix
|
||||
config = lib.mkIf (config.omnixy.theme == "tokyo-night") {
|
||||
# All theme configurations here
|
||||
};
|
||||
```
|
||||
|
||||
## Theme Switching
|
||||
|
||||
### Command Line
|
||||
```bash
|
||||
# List available themes
|
||||
omnixy theme list
|
||||
|
||||
# Switch theme
|
||||
omnixy theme set gruvbox
|
||||
|
||||
# Get current theme
|
||||
omnixy theme get
|
||||
```
|
||||
|
||||
### System Integration
|
||||
Theme switching:
|
||||
1. Updates `configuration.nix` with new theme
|
||||
2. Rebuilds system configuration
|
||||
3. All applications automatically use new colors
|
||||
4. No manual restart required for most applications
|
||||
|
||||
### Scriptable Interface
|
||||
```bash
|
||||
# Automated theme switching
|
||||
current=$(omnixy --quiet theme get)
|
||||
omnixy theme list --quiet | grep -v "$current" | head -1 | xargs omnixy theme set
|
||||
|
||||
# JSON output for automation
|
||||
omnixy --json theme list | jq -r '.available[]'
|
||||
```
|
||||
|
||||
## Creating Custom Themes
|
||||
|
||||
### 1. Copy Existing Theme
|
||||
```bash
|
||||
cp modules/themes/tokyo-night.nix modules/themes/my-theme.nix
|
||||
```
|
||||
|
||||
### 2. Define Color Palette
|
||||
```nix
|
||||
let
|
||||
colors = {
|
||||
bg = "#your-bg-color";
|
||||
fg = "#your-fg-color";
|
||||
# Define your complete palette
|
||||
};
|
||||
```
|
||||
|
||||
### 3. Update Theme Condition
|
||||
```nix
|
||||
config = lib.mkIf (config.omnixy.theme == "my-theme") {
|
||||
# Theme configurations
|
||||
};
|
||||
```
|
||||
|
||||
### 4. Add to Available Themes
|
||||
Update theme management scripts to include your new theme.
|
||||
|
||||
### 5. Test and Iterate
|
||||
```bash
|
||||
# Test your theme
|
||||
omnixy theme set my-theme
|
||||
|
||||
# Make adjustments and rebuild
|
||||
omnixy-rebuild
|
||||
```
|
||||
|
||||
## Theme Guidelines
|
||||
|
||||
### Color Accessibility
|
||||
- Ensure adequate contrast ratios (4.5:1 for normal text)
|
||||
- Test with color blindness simulators
|
||||
- Provide clear visual hierarchy
|
||||
|
||||
### Consistency
|
||||
- Use semantic color naming (primary, secondary, accent)
|
||||
- Maintain consistent color relationships
|
||||
- Apply colors systematically across applications
|
||||
|
||||
### Performance
|
||||
- Avoid complex color calculations
|
||||
- Use static color definitions
|
||||
- Test theme switching performance
|
||||
|
||||
### Documentation
|
||||
- Document color meanings and usage
|
||||
- Provide theme inspiration and character
|
||||
- Include screenshots or examples
|
||||
|
||||
## Theme Validation
|
||||
|
||||
### Color Contrast Testing
|
||||
```bash
|
||||
# Test theme accessibility
|
||||
omnixy theme set my-theme
|
||||
# Use accessibility tools to check contrast ratios
|
||||
```
|
||||
|
||||
### Visual Testing
|
||||
- Test all major applications
|
||||
- Verify readability in different lighting
|
||||
- Check consistency across different screen types
|
||||
|
||||
### Integration Testing
|
||||
- Ensure theme switching works properly
|
||||
- Verify all applications receive theme updates
|
||||
- Test with different desktop configurations
|
||||
|
||||
This comprehensive theme system ensures a cohesive, beautiful, and customizable visual experience across the entire OmniXY desktop environment.
|
||||
@@ -55,7 +55,7 @@ in
|
||||
# security.pam.enableEcryptfs = true;
|
||||
|
||||
# Automatic login (disable for production)
|
||||
services.xserver.displayManager.autoLogin = {
|
||||
services.displayManager.autoLogin = {
|
||||
enable = false;
|
||||
user = cfg.user;
|
||||
};
|
||||
|
||||
@@ -11,9 +11,26 @@ let
|
||||
in
|
||||
{
|
||||
config = mkIf (cfg.enable or true) {
|
||||
# Add walker to system packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Add walker and convenience scripts to system packages
|
||||
environment.systemPackages = (with pkgs; [
|
||||
walker
|
||||
]) ++ [
|
||||
# Convenience scripts
|
||||
(omnixy.makeScript "omnixy-launcher" "Launch OmniXY app launcher" ''
|
||||
walker --config ~/.config/walker/config.json --css ~/.config/walker/themes/style.css
|
||||
'')
|
||||
|
||||
(omnixy.makeScript "omnixy-run" "Quick command runner" ''
|
||||
walker --modules runner --config ~/.config/walker/config.json --css ~/.config/walker/themes/style.css
|
||||
'')
|
||||
|
||||
(omnixy.makeScript "omnixy-apps" "Application launcher" ''
|
||||
walker --modules applications --config ~/.config/walker/config.json --css ~/.config/walker/themes/style.css
|
||||
'')
|
||||
|
||||
(omnixy.makeScript "omnixy-files" "File finder" ''
|
||||
walker --modules finder --config ~/.config/walker/config.json --css ~/.config/walker/themes/style.css
|
||||
'')
|
||||
];
|
||||
|
||||
# Create Walker configuration
|
||||
@@ -368,7 +385,7 @@ in
|
||||
'';
|
||||
|
||||
# Add to user environment
|
||||
omnixy.forUser {
|
||||
home-manager.users.${config.omnixy.user} = {
|
||||
# Set XDG config dir for Walker
|
||||
xdg.configFile."walker/config.json".source =
|
||||
config.environment.etc."omnixy/walker/config.json".source;
|
||||
@@ -400,23 +417,6 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
# Create convenience scripts
|
||||
environment.systemPackages = [
|
||||
(omnixy.makeScript "omnixy-launcher" "Launch OmniXY app launcher" ''
|
||||
walker --config ~/.config/walker/config.json --css ~/.config/walker/themes/style.css
|
||||
'')
|
||||
|
||||
(omnixy.makeScript "omnixy-run" "Quick command runner" ''
|
||||
walker --modules runner --config ~/.config/walker/config.json --css ~/.config/walker/themes/style.css
|
||||
'')
|
||||
|
||||
(omnixy.makeScript "omnixy-apps" "Application launcher" ''
|
||||
walker --modules applications --config ~/.config/walker/config.json --css ~/.config/walker/themes/style.css
|
||||
'')
|
||||
|
||||
(omnixy.makeScript "omnixy-files" "File finder" ''
|
||||
walker --modules finder --config ~/.config/walker/config.json --css ~/.config/walker/themes/style.css
|
||||
'')
|
||||
];
|
||||
# Convenience scripts are now consolidated above
|
||||
};
|
||||
}
|
||||
BIN
nixos-installer.qcow2
Normal file
BIN
nixos-installer.qcow2
Normal file
Binary file not shown.
BIN
omnixy.qcow2
Normal file
BIN
omnixy.qcow2
Normal file
Binary file not shown.
251
packages/README.md
Normal file
251
packages/README.md
Normal file
@@ -0,0 +1,251 @@
|
||||
# Packages Directory - Custom Nix Packages
|
||||
|
||||
The `packages/` directory contains custom Nix package definitions for OmniXY-specific tools and utilities. These packages are built and distributed through the Nix package manager as part of the OmniXY system.
|
||||
|
||||
## Package Architecture
|
||||
|
||||
Each package follows the standard Nix packaging format:
|
||||
```nix
|
||||
{ pkgs, lib, ... }:
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
pname = "package-name";
|
||||
version = "1.0.0";
|
||||
|
||||
# Package definition
|
||||
# ...
|
||||
|
||||
meta = with lib; {
|
||||
description = "Package description";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## Current Packages
|
||||
|
||||
### `scripts.nix`
|
||||
**Purpose**: OmniXY utility scripts package
|
||||
**What it contains**: All the management and utility scripts for OmniXY system
|
||||
|
||||
**Generated Scripts**:
|
||||
|
||||
#### System Management
|
||||
- `omnixy`: Main command interface with `--quiet` and `--json` modes
|
||||
- `omnixy-update`: System and flake updates with progress indication
|
||||
- `omnixy-clean`: Garbage collection and store optimization
|
||||
- `omnixy-rebuild`: Wrapper for `nixos-rebuild switch`
|
||||
|
||||
#### Theme Management
|
||||
- `omnixy-theme-set`: Set system theme with validation
|
||||
- `omnixy-theme-list`: List available themes (plain/JSON output)
|
||||
- `omnixy-theme-get`: Get current theme (scriptable output)
|
||||
|
||||
#### Package Management
|
||||
- `omnixy-search`: Search Nix packages
|
||||
- `omnixy-install`: Package installation guide
|
||||
|
||||
#### Development Tools
|
||||
- `omnixy-dev-shell`: Language-specific development shells
|
||||
- Supports: rust, go, python, node/js, c/cpp
|
||||
|
||||
#### Utilities
|
||||
- `omnixy-screenshot`: Screenshot tool with region/window/full modes
|
||||
- `omnixy-info`: System information with JSON/quiet modes
|
||||
- `omnixy-help`: Comprehensive help system
|
||||
|
||||
**Build Process**:
|
||||
1. Creates all scripts in `installPhase`
|
||||
2. Sets executable permissions
|
||||
3. Patches interpreter paths
|
||||
4. Validates script syntax
|
||||
|
||||
**Dependencies**:
|
||||
- `bash`: Shell interpreter
|
||||
- `coreutils`: Basic Unix utilities
|
||||
- `gnugrep`, `gnused`, `gawk`: Text processing
|
||||
- `jq`: JSON processing
|
||||
- `curl`, `wget`: Network utilities
|
||||
- `git`: Version control
|
||||
- `fzf`, `ripgrep`: Search tools
|
||||
|
||||
### `plymouth-theme.nix` (Commented Out)
|
||||
**Purpose**: Plymouth boot theme package
|
||||
**Status**: Disabled until fully implemented
|
||||
**What it would contain**: Custom boot splash theme for OmniXY
|
||||
|
||||
## Package Integration
|
||||
|
||||
### Flake Integration
|
||||
Packages are exported in `flake.nix`:
|
||||
```nix
|
||||
packages.${system} = {
|
||||
omnixy-scripts = pkgs.callPackage ./packages/scripts.nix {};
|
||||
# Additional packages...
|
||||
};
|
||||
```
|
||||
|
||||
### System Installation
|
||||
Scripts package is installed system-wide in the main configuration, making all utilities available in PATH.
|
||||
|
||||
### Development Access
|
||||
Packages can be built individually for testing:
|
||||
```bash
|
||||
# Build scripts package
|
||||
nix build .#omnixy-scripts
|
||||
|
||||
# Test individual script
|
||||
./result/bin/omnixy --help
|
||||
```
|
||||
|
||||
## Script Features
|
||||
|
||||
### Unix Philosophy Compliance
|
||||
All scripts follow Unix principles:
|
||||
|
||||
**Clean Output Separation**:
|
||||
```bash
|
||||
# Human-readable (default)
|
||||
omnixy info
|
||||
|
||||
# Machine-readable
|
||||
omnixy --json info | jq .system.version
|
||||
|
||||
# Scriptable
|
||||
omnixy --quiet update && echo "Updated successfully"
|
||||
```
|
||||
|
||||
**Composability**:
|
||||
```bash
|
||||
# Theme management pipeline
|
||||
current_theme=$(omnixy --quiet theme get)
|
||||
omnixy theme list --quiet | grep -v "$current_theme" | head -1 | xargs omnixy theme set
|
||||
```
|
||||
|
||||
**Error Handling**:
|
||||
- Exit codes: 0 for success, 1 for failure
|
||||
- Errors to stderr, data to stdout
|
||||
- Graceful handling of missing files/permissions
|
||||
|
||||
### Environment Variables
|
||||
Scripts respect global settings:
|
||||
|
||||
- `OMNIXY_QUIET=1`: Minimal output mode
|
||||
- `OMNIXY_JSON=1`: JSON output where applicable
|
||||
|
||||
### Theme System Integration
|
||||
Theme scripts provide complete theme management:
|
||||
- List all 11 available themes
|
||||
- Get current theme for scripting
|
||||
- Set theme with validation and rebuild
|
||||
- Support for both interactive and automated usage
|
||||
|
||||
### Development Environment Support
|
||||
Development scripts provide:
|
||||
- Quick access to language-specific environments
|
||||
- Consistent tooling across languages
|
||||
- Integration with system configuration
|
||||
|
||||
## Adding New Packages
|
||||
|
||||
To add a new package:
|
||||
|
||||
1. **Create Package File**:
|
||||
```nix
|
||||
# packages/my-tool.nix
|
||||
{ pkgs, lib, ... }:
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
pname = "my-tool";
|
||||
version = "1.0.0";
|
||||
|
||||
# Package definition
|
||||
}
|
||||
```
|
||||
|
||||
2. **Add to Flake**:
|
||||
```nix
|
||||
# In flake.nix packages section
|
||||
my-tool = pkgs.callPackage ./packages/my-tool.nix {};
|
||||
```
|
||||
|
||||
3. **Install in System**:
|
||||
```nix
|
||||
# In configuration or module
|
||||
environment.systemPackages = with pkgs; [
|
||||
# ... other packages
|
||||
my-tool
|
||||
];
|
||||
```
|
||||
|
||||
## Package Categories
|
||||
|
||||
### System Utilities
|
||||
Tools for managing the OmniXY system itself:
|
||||
- Configuration management
|
||||
- System updates and maintenance
|
||||
- Backup and restore operations
|
||||
|
||||
### User Interface Tools
|
||||
Scripts for desktop and user interaction:
|
||||
- Theme management
|
||||
- Screenshot utilities
|
||||
- Information display
|
||||
|
||||
### Development Aids
|
||||
Tools for software development:
|
||||
- Environment management
|
||||
- Build and deployment helpers
|
||||
- Debug and diagnostic tools
|
||||
|
||||
### Integration Scripts
|
||||
Utilities for integrating with external systems:
|
||||
- Cloud services
|
||||
- Version control
|
||||
- Package repositories
|
||||
|
||||
## Build System
|
||||
|
||||
### Derivation Structure
|
||||
Each package is a Nix derivation with:
|
||||
- **Inputs**: Dependencies and build tools
|
||||
- **Build Process**: How to create the package
|
||||
- **Outputs**: Resulting files and executables
|
||||
- **Metadata**: Description, license, platforms
|
||||
|
||||
### Build Phases
|
||||
For script packages:
|
||||
1. **Setup**: Prepare build environment
|
||||
2. **Install**: Create scripts and set permissions
|
||||
3. **Fixup**: Patch interpreters and validate
|
||||
4. **Package**: Create final Nix store paths
|
||||
|
||||
### Quality Assurance
|
||||
- Syntax checking during build
|
||||
- Interpreter path patching
|
||||
- Permission validation
|
||||
- Dependency verification
|
||||
|
||||
## Testing and Validation
|
||||
|
||||
### Build Testing
|
||||
```bash
|
||||
# Test package builds correctly
|
||||
nix build .#omnixy-scripts
|
||||
|
||||
# Validate all scripts are created
|
||||
ls result/bin/ | wc -l
|
||||
|
||||
# Test script functionality
|
||||
result/bin/omnixy --help
|
||||
```
|
||||
|
||||
### Integration Testing
|
||||
```bash
|
||||
# Test in clean environment
|
||||
nix develop --command bash -c "omnixy-info --json | jq .system"
|
||||
|
||||
# Test cross-script integration
|
||||
nix develop --command bash -c "omnixy theme list --quiet | head -1 | xargs echo"
|
||||
```
|
||||
|
||||
This packaging system provides a robust foundation for distributing and managing OmniXY utilities while maintaining the reproducibility and reliability of the Nix ecosystem.
|
||||
@@ -31,34 +31,62 @@ pkgs.stdenv.mkDerivation rec {
|
||||
set -e
|
||||
|
||||
THEME="$1"
|
||||
AVAILABLE_THEMES="tokyo-night catppuccin gruvbox nord everforest rose-pine kanagawa"
|
||||
AVAILABLE_THEMES="tokyo-night catppuccin gruvbox nord everforest rose-pine kanagawa catppuccin-latte matte-black osaka-jade ristretto"
|
||||
|
||||
if [ -z "$THEME" ]; then
|
||||
echo "Usage: omnixy-theme-set <theme>"
|
||||
echo "Available themes: $AVAILABLE_THEMES"
|
||||
if [[ "''${OMNIXY_QUIET:-}" == "1" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
echo "Usage: omnixy theme set <theme>" >&2
|
||||
echo "Available themes: $AVAILABLE_THEMES" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! echo "$AVAILABLE_THEMES" | grep -qw "$THEME"; then
|
||||
echo "Error: Unknown theme '$THEME'"
|
||||
echo "Available themes: $AVAILABLE_THEMES"
|
||||
if [[ "''${OMNIXY_QUIET:-}" == "1" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
echo "Error: Unknown theme '$THEME'" >&2
|
||||
echo "Available themes: $AVAILABLE_THEMES" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Switching to theme: $THEME"
|
||||
|
||||
# Update configuration
|
||||
sudo sed -i "s/currentTheme = \".*\"/currentTheme = \"$THEME\"/" /etc/nixos/configuration.nix
|
||||
|
||||
# Rebuild system
|
||||
sudo nixos-rebuild switch --flake /etc/nixos#omnixy
|
||||
if [[ "''${OMNIXY_QUIET:-}" != "1" ]]; then
|
||||
echo "Switching to theme: $THEME"
|
||||
fi
|
||||
|
||||
echo "Theme switched to $THEME successfully!"
|
||||
# Rebuild system
|
||||
if [[ "''${OMNIXY_QUIET:-}" == "1" ]]; then
|
||||
sudo nixos-rebuild switch --flake /etc/nixos#omnixy >/dev/null 2>&1
|
||||
else
|
||||
sudo nixos-rebuild switch --flake /etc/nixos#omnixy
|
||||
echo "Theme switched to $THEME successfully!"
|
||||
fi
|
||||
EOF
|
||||
chmod +x $out/bin/omnixy-theme-set
|
||||
|
||||
cat > $out/bin/omnixy-theme-list << 'EOF'
|
||||
#!/usr/bin/env bash
|
||||
|
||||
THEMES="tokyo-night catppuccin gruvbox nord everforest rose-pine kanagawa catppuccin-latte matte-black osaka-jade ristretto"
|
||||
|
||||
if [[ "''${OMNIXY_QUIET:-}" == "1" ]]; then
|
||||
echo "$THEMES" | tr ' ' '\n'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "''${OMNIXY_JSON:-}" == "1" ]]; then
|
||||
current=$(grep currentTheme /etc/nixos/configuration.nix 2>/dev/null | cut -d'"' -f2 || echo "tokyo-night")
|
||||
echo '{'
|
||||
echo ' "available": ["'$(echo "$THEMES" | sed 's/ /", "/g')'"],'
|
||||
echo ' "current": "'$current'"'
|
||||
echo '}'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Available OmniXY themes:"
|
||||
echo "========================"
|
||||
echo " • tokyo-night (default)"
|
||||
@@ -68,38 +96,70 @@ pkgs.stdenv.mkDerivation rec {
|
||||
echo " • everforest"
|
||||
echo " • rose-pine"
|
||||
echo " • kanagawa"
|
||||
echo " • catppuccin-latte"
|
||||
echo " • matte-black"
|
||||
echo " • osaka-jade"
|
||||
echo " • ristretto"
|
||||
echo ""
|
||||
echo "Current theme: $(grep currentTheme /etc/nixos/configuration.nix | cut -d'"' -f2)"
|
||||
echo "Current theme: $(grep currentTheme /etc/nixos/configuration.nix 2>/dev/null | cut -d'"' -f2 || echo "tokyo-night")"
|
||||
echo ""
|
||||
echo "To change theme, run: omnixy-theme-set <theme-name>"
|
||||
echo "To change theme, run: omnixy theme set <theme-name>"
|
||||
EOF
|
||||
chmod +x $out/bin/omnixy-theme-list
|
||||
|
||||
# Get current theme command
|
||||
cat > $out/bin/omnixy-theme-get << 'EOF'
|
||||
#!/usr/bin/env bash
|
||||
current=$(grep currentTheme /etc/nixos/configuration.nix 2>/dev/null | cut -d'"' -f2 || echo "tokyo-night")
|
||||
|
||||
if [[ "''${OMNIXY_JSON:-}" == "1" ]]; then
|
||||
echo '{"current": "'$current'"}'
|
||||
else
|
||||
echo "$current"
|
||||
fi
|
||||
EOF
|
||||
chmod +x $out/bin/omnixy-theme-get
|
||||
|
||||
# System management
|
||||
cat > $out/bin/omnixy-update << 'EOF'
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
echo "🔄 Updating OmniXY system..."
|
||||
echo ""
|
||||
if [[ "''${OMNIXY_QUIET:-}" != "1" ]]; then
|
||||
echo "🔄 Updating OmniXY system..."
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Update flake inputs
|
||||
echo "📦 Updating flake inputs..."
|
||||
if [[ "''${OMNIXY_QUIET:-}" != "1" ]]; then
|
||||
echo "📦 Updating flake inputs..."
|
||||
fi
|
||||
cd /etc/nixos
|
||||
sudo nix flake update
|
||||
if [[ "''${OMNIXY_QUIET:-}" == "1" ]]; then
|
||||
sudo nix flake update >/dev/null 2>&1
|
||||
else
|
||||
sudo nix flake update
|
||||
fi
|
||||
|
||||
# Show what changed
|
||||
echo ""
|
||||
echo "📊 Changes:"
|
||||
git diff flake.lock | grep -E "^\+" | head -20
|
||||
if [[ "''${OMNIXY_QUIET:-}" != "1" ]]; then
|
||||
echo ""
|
||||
echo "📊 Changes:"
|
||||
git diff flake.lock | grep -E "^\+" | head -20
|
||||
fi
|
||||
|
||||
# Rebuild system
|
||||
echo ""
|
||||
echo "🏗️ Rebuilding system..."
|
||||
sudo nixos-rebuild switch --flake .#omnixy
|
||||
|
||||
echo ""
|
||||
echo "✅ System updated successfully!"
|
||||
if [[ "''${OMNIXY_QUIET:-}" != "1" ]]; then
|
||||
echo ""
|
||||
echo "🏗️ Rebuilding system..."
|
||||
fi
|
||||
if [[ "''${OMNIXY_QUIET:-}" == "1" ]]; then
|
||||
sudo nixos-rebuild switch --flake .#omnixy >/dev/null 2>&1
|
||||
else
|
||||
sudo nixos-rebuild switch --flake .#omnixy
|
||||
echo ""
|
||||
echo "✅ System updated successfully!"
|
||||
fi
|
||||
EOF
|
||||
chmod +x $out/bin/omnixy-update
|
||||
|
||||
@@ -107,29 +167,44 @@ pkgs.stdenv.mkDerivation rec {
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
echo "🧹 Cleaning OmniXY system..."
|
||||
echo ""
|
||||
if [[ "''${OMNIXY_QUIET:-}" != "1" ]]; then
|
||||
echo "🧹 Cleaning OmniXY system..."
|
||||
echo ""
|
||||
|
||||
# Show current store size
|
||||
echo "Current store size:"
|
||||
du -sh /nix/store 2>/dev/null || echo "Unable to calculate"
|
||||
echo ""
|
||||
# Show current store size
|
||||
echo "Current store size:"
|
||||
du -sh /nix/store 2>/dev/null || echo "Unable to calculate"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Run garbage collection
|
||||
echo "Running garbage collection..."
|
||||
sudo nix-collect-garbage -d
|
||||
if [[ "''${OMNIXY_QUIET:-}" != "1" ]]; then
|
||||
echo "Running garbage collection..."
|
||||
fi
|
||||
if [[ "''${OMNIXY_QUIET:-}" == "1" ]]; then
|
||||
sudo nix-collect-garbage -d >/dev/null 2>&1
|
||||
else
|
||||
sudo nix-collect-garbage -d
|
||||
fi
|
||||
|
||||
# Optimize store
|
||||
echo "Optimizing Nix store..."
|
||||
sudo nix-store --optimise
|
||||
if [[ "''${OMNIXY_QUIET:-}" != "1" ]]; then
|
||||
echo "Optimizing Nix store..."
|
||||
fi
|
||||
if [[ "''${OMNIXY_QUIET:-}" == "1" ]]; then
|
||||
sudo nix-store --optimise >/dev/null 2>&1
|
||||
else
|
||||
sudo nix-store --optimise
|
||||
fi
|
||||
|
||||
# Show new size
|
||||
echo ""
|
||||
echo "New store size:"
|
||||
du -sh /nix/store 2>/dev/null || echo "Unable to calculate"
|
||||
|
||||
echo ""
|
||||
echo "✅ Cleanup complete!"
|
||||
if [[ "''${OMNIXY_QUIET:-}" != "1" ]]; then
|
||||
# Show new size
|
||||
echo ""
|
||||
echo "New store size:"
|
||||
du -sh /nix/store 2>/dev/null || echo "Unable to calculate"
|
||||
echo ""
|
||||
echo "✅ Cleanup complete!"
|
||||
fi
|
||||
EOF
|
||||
chmod +x $out/bin/omnixy-clean
|
||||
|
||||
@@ -251,31 +326,71 @@ pkgs.stdenv.mkDerivation rec {
|
||||
cat > $out/bin/omnixy-info << 'EOF'
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Gather data once
|
||||
VERSION=$(nixos-version)
|
||||
KERNEL=$(uname -r)
|
||||
THEME=$(grep currentTheme /etc/nixos/configuration.nix 2>/dev/null | cut -d'"' -f2 || echo "tokyo-night")
|
||||
CPU=$(lscpu | grep 'Model name' | cut -d':' -f2 | xargs)
|
||||
MEMORY=$(free -h | awk '/^Mem:/ {print $2}')
|
||||
DISK=$(df -h / | awk 'NR==2 {print $2}')
|
||||
|
||||
if [[ "''${OMNIXY_JSON:-}" == "1" ]]; then
|
||||
echo "{"
|
||||
echo " \"system\": {"
|
||||
echo " \"version\": \"$VERSION\","
|
||||
echo " \"kernel\": \"$KERNEL\","
|
||||
echo " \"theme\": \"$THEME\","
|
||||
echo " \"user\": \"$USER\","
|
||||
echo " \"shell\": \"$SHELL\","
|
||||
echo " \"terminal\": \"$TERM\""
|
||||
echo " },"
|
||||
echo " \"hardware\": {"
|
||||
echo " \"cpu\": \"$CPU\","
|
||||
echo " \"memory\": \"$MEMORY\","
|
||||
echo " \"disk\": \"$DISK\""
|
||||
echo " }"
|
||||
echo "}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "''${OMNIXY_QUIET:-}" == "1" ]]; then
|
||||
echo "version=$VERSION"
|
||||
echo "kernel=$KERNEL"
|
||||
echo "theme=$THEME"
|
||||
echo "user=$USER"
|
||||
echo "shell=$SHELL"
|
||||
echo "terminal=$TERM"
|
||||
echo "cpu=$CPU"
|
||||
echo "memory=$MEMORY"
|
||||
echo "disk=$DISK"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "╭──────────────────────────────╮"
|
||||
echo "│ OMNIXY NIXOS │"
|
||||
echo "╰──────────────────────────────╯"
|
||||
echo ""
|
||||
echo "System Information:"
|
||||
echo "==================="
|
||||
echo "Version: $(nixos-version)"
|
||||
echo "Kernel: $(uname -r)"
|
||||
echo "Theme: $(grep currentTheme /etc/nixos/configuration.nix 2>/dev/null | cut -d'"' -f2 || echo "default")"
|
||||
echo "Version: $VERSION"
|
||||
echo "Kernel: $KERNEL"
|
||||
echo "Theme: $THEME"
|
||||
echo "User: $USER"
|
||||
echo "Shell: $SHELL"
|
||||
echo "Terminal: $TERM"
|
||||
echo ""
|
||||
echo "Hardware:"
|
||||
echo "========="
|
||||
echo "CPU: $(lscpu | grep 'Model name' | cut -d':' -f2 | xargs)"
|
||||
echo "Memory: $(free -h | awk '/^Mem:/ {print $2}')"
|
||||
echo "Disk: $(df -h / | awk 'NR==2 {print $2}')"
|
||||
echo "CPU: $CPU"
|
||||
echo "Memory: $MEMORY"
|
||||
echo "Disk: $DISK"
|
||||
echo ""
|
||||
echo "Quick Commands:"
|
||||
echo "=============="
|
||||
echo " omnixy-help - Show help"
|
||||
echo " omnixy-update - Update system"
|
||||
echo " omnixy-clean - Clean system"
|
||||
echo " omnixy-theme - Change theme"
|
||||
echo " omnixy help - Show help"
|
||||
echo " omnixy update - Update system"
|
||||
echo " omnixy clean - Clean system"
|
||||
echo " omnixy theme - List themes"
|
||||
EOF
|
||||
chmod +x $out/bin/omnixy-info
|
||||
|
||||
@@ -339,6 +454,27 @@ pkgs.stdenv.mkDerivation rec {
|
||||
cat > $out/bin/omnixy << 'EOF'
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Parse global flags
|
||||
QUIET=false
|
||||
JSON=false
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--quiet|-q)
|
||||
QUIET=true
|
||||
export OMNIXY_QUIET=1
|
||||
shift
|
||||
;;
|
||||
--json)
|
||||
JSON=true
|
||||
export OMNIXY_JSON=1
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
CMD="''${1:-help}"
|
||||
shift || true
|
||||
|
||||
@@ -350,11 +486,25 @@ pkgs.stdenv.mkDerivation rec {
|
||||
omnixy-clean "$@"
|
||||
;;
|
||||
theme)
|
||||
if [ -n "$1" ]; then
|
||||
omnixy-theme-set "$@"
|
||||
else
|
||||
omnixy-theme-list
|
||||
fi
|
||||
case "''${1:-}" in
|
||||
set)
|
||||
shift
|
||||
omnixy-theme-set "$@"
|
||||
;;
|
||||
list|ls)
|
||||
omnixy-theme-list "$@"
|
||||
;;
|
||||
get|current)
|
||||
omnixy-theme-get "$@"
|
||||
;;
|
||||
"")
|
||||
omnixy-theme-list "$@"
|
||||
;;
|
||||
*)
|
||||
# Legacy: assume it's a theme name
|
||||
omnixy-theme-set "$@"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
search)
|
||||
omnixy-search "$@"
|
||||
@@ -369,8 +519,10 @@ pkgs.stdenv.mkDerivation rec {
|
||||
omnixy-help "$@"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown command: $CMD"
|
||||
echo "Run 'omnixy help' for available commands"
|
||||
if [[ "$QUIET" == "false" ]]; then
|
||||
echo "Unknown command: $CMD" >&2
|
||||
echo "Run 'omnixy help' for available commands" >&2
|
||||
fi
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
1
result
Symbolic link
1
result
Symbolic link
@@ -0,0 +1 @@
|
||||
/nix/store/il9jlnvlmmfpd70gi39d8lmczjcpfz7g-omnixy-scripts-1.0.0
|
||||
277
scripts/README.md
Normal file
277
scripts/README.md
Normal file
@@ -0,0 +1,277 @@
|
||||
# Scripts Directory - Unix Philosophy Tools
|
||||
|
||||
The `scripts/` directory contains focused, composable utilities that follow the Unix philosophy of "do one thing and do it well." These tools are designed to be scriptable, pipeable, and work together to accomplish complex tasks.
|
||||
|
||||
## Unix Philosophy Implementation
|
||||
|
||||
Each script in this directory follows these principles:
|
||||
1. **Single Purpose**: Does one job well
|
||||
2. **Clean Output**: Separates data from decoration
|
||||
3. **Pipeable**: Output can be input to other programs
|
||||
4. **Scriptable**: Non-interactive by default
|
||||
5. **Composable**: Works with other tools
|
||||
|
||||
## Core System Tools
|
||||
|
||||
### `omnixy-check-system`
|
||||
**Purpose**: System requirements validation
|
||||
**What it does**:
|
||||
- Verifies NixOS installation
|
||||
- Checks user permissions
|
||||
- Validates system prerequisites
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
# Check everything
|
||||
./omnixy-check-system
|
||||
|
||||
# Check only NixOS
|
||||
./omnixy-check-system --nixos-only
|
||||
|
||||
# Check permissions only
|
||||
./omnixy-check-system --permissions-only
|
||||
|
||||
# Silent check for scripting
|
||||
./omnixy-check-system --quiet
|
||||
|
||||
# JSON output
|
||||
OMNIXY_JSON=1 ./omnixy-check-system
|
||||
```
|
||||
|
||||
**Exit Codes**:
|
||||
- 0: All checks passed
|
||||
- 1: Critical failure (not NixOS, etc.)
|
||||
|
||||
**Output Modes**:
|
||||
- Default: Human-readable status
|
||||
- `--quiet`: No output, just exit codes
|
||||
- `--json`: Machine-readable JSON
|
||||
|
||||
### `omnixy-backup-config`
|
||||
**Purpose**: Configuration backup management
|
||||
**What it does**:
|
||||
- Creates timestamped backups of `/etc/nixos`
|
||||
- Outputs backup location for scripting
|
||||
- Handles non-existent configurations gracefully
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
# Default backup with timestamp
|
||||
backup_path=$(./omnixy-backup-config)
|
||||
|
||||
# Specify backup location
|
||||
./omnixy-backup-config /custom/backup/path
|
||||
|
||||
# Get help
|
||||
./omnixy-backup-config --help
|
||||
```
|
||||
|
||||
**Output**:
|
||||
- Prints backup directory path to stdout
|
||||
- Can be captured and used by other scripts
|
||||
|
||||
### `omnixy-install-files`
|
||||
**Purpose**: File installation management
|
||||
**What it does**:
|
||||
- Copies configuration files to destination
|
||||
- Sets proper permissions
|
||||
- Handles directory creation
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
# Install from current directory to /etc/nixos
|
||||
./omnixy-install-files
|
||||
|
||||
# Specify source and destination
|
||||
./omnixy-install-files /path/to/source /path/to/dest
|
||||
|
||||
# Get help
|
||||
./omnixy-install-files --help
|
||||
```
|
||||
|
||||
**Features**:
|
||||
- Automatic permission setting
|
||||
- Directory creation
|
||||
- Error handling
|
||||
|
||||
### `omnixy-configure-user`
|
||||
**Purpose**: User configuration management
|
||||
**What it does**:
|
||||
- Updates system configuration with username
|
||||
- Modifies both system and home configurations
|
||||
- Validates username format
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
# Interactive mode (prompts for username)
|
||||
username=$(./omnixy-configure-user)
|
||||
|
||||
# Non-interactive mode
|
||||
./omnixy-configure-user alice
|
||||
|
||||
# Specify configuration files
|
||||
./omnixy-configure-user alice /etc/nixos/configuration.nix /etc/nixos/home.nix
|
||||
|
||||
# Get help
|
||||
./omnixy-configure-user --help
|
||||
```
|
||||
|
||||
**Validation**:
|
||||
- Username must start with letter
|
||||
- Can contain letters, numbers, underscore, dash
|
||||
- Outputs the configured username
|
||||
|
||||
### `omnixy-build-system`
|
||||
**Purpose**: System building and switching
|
||||
**What it does**:
|
||||
- Builds NixOS configuration
|
||||
- Switches to new configuration
|
||||
- Supports dry-run testing
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
# Build and switch system
|
||||
./omnixy-build-system
|
||||
|
||||
# Build specific configuration
|
||||
./omnixy-build-system /path/to/config custom-config
|
||||
|
||||
# Dry run (test only)
|
||||
./omnixy-build-system --dry-run
|
||||
|
||||
# Get help
|
||||
./omnixy-build-system --help
|
||||
```
|
||||
|
||||
**Modes**:
|
||||
- Default: Build and switch to configuration
|
||||
- `--dry-run`: Test build without switching
|
||||
- Quiet mode: Minimal output for scripting
|
||||
|
||||
## Tool Composition Examples
|
||||
|
||||
These tools are designed to work together:
|
||||
|
||||
### Complete Installation Pipeline
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# Automated OmniXY installation
|
||||
|
||||
# Check system prerequisites
|
||||
./scripts/omnixy-check-system || exit 1
|
||||
|
||||
# Backup existing configuration
|
||||
backup_path=$(./scripts/omnixy-backup-config)
|
||||
echo "Backup created: $backup_path"
|
||||
|
||||
# Install new configuration
|
||||
./scripts/omnixy-install-files
|
||||
|
||||
# Configure user
|
||||
username=$(./scripts/omnixy-configure-user "$USER")
|
||||
echo "Configured for user: $username"
|
||||
|
||||
# Test build first
|
||||
./scripts/omnixy-build-system --dry-run
|
||||
echo "Configuration test passed"
|
||||
|
||||
# Apply changes
|
||||
./scripts/omnixy-build-system
|
||||
echo "System updated successfully"
|
||||
```
|
||||
|
||||
### Backup and Restore Workflow
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# Backup current config and test new one
|
||||
|
||||
# Create backup
|
||||
backup=$(./scripts/omnixy-backup-config)
|
||||
|
||||
# Install new config
|
||||
./scripts/omnixy-install-files /path/to/new/config
|
||||
|
||||
# Test new config
|
||||
if ! ./scripts/omnixy-build-system --dry-run; then
|
||||
echo "New config failed, restoring backup"
|
||||
./scripts/omnixy-install-files "$backup" /etc/nixos
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "New configuration validated"
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
These tools respect the following environment variables:
|
||||
|
||||
### `OMNIXY_QUIET`
|
||||
When set to `1`, tools produce minimal output suitable for scripting:
|
||||
```bash
|
||||
export OMNIXY_QUIET=1
|
||||
./scripts/omnixy-check-system # No output, just exit code
|
||||
```
|
||||
|
||||
### `OMNIXY_JSON`
|
||||
When set to `1`, tools output JSON where applicable:
|
||||
```bash
|
||||
export OMNIXY_JSON=1
|
||||
./scripts/omnixy-check-system # JSON status output
|
||||
```
|
||||
|
||||
## Integration with Main Installer
|
||||
|
||||
The main `install-simple.sh` script uses these tools:
|
||||
|
||||
```bash
|
||||
# From install-simple.sh
|
||||
scripts/omnixy-check-system
|
||||
backup_path=$(scripts/omnixy-backup-config)
|
||||
scripts/omnixy-install-files
|
||||
username=$(scripts/omnixy-configure-user "$username")
|
||||
scripts/omnixy-build-system --dry-run # if dry run mode
|
||||
scripts/omnixy-build-system # actual installation
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
All scripts follow consistent error handling:
|
||||
- Exit code 0 for success
|
||||
- Exit code 1 for failures
|
||||
- Error messages to stderr
|
||||
- Data output to stdout
|
||||
|
||||
Example error handling:
|
||||
```bash
|
||||
if ! ./scripts/omnixy-check-system --quiet; then
|
||||
echo "System check failed" >&2
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
|
||||
## Adding New Tools
|
||||
|
||||
When adding new Unix philosophy tools:
|
||||
|
||||
1. **Single Purpose**: One job per script
|
||||
2. **Help Option**: `--help` flag with usage info
|
||||
3. **Error Handling**: Proper exit codes and stderr
|
||||
4. **Environment Variables**: Respect `OMNIXY_QUIET` and `OMNIXY_JSON`
|
||||
5. **Documentation**: Clear purpose and usage examples
|
||||
6. **Testing**: Verify with various inputs and edge cases
|
||||
|
||||
## Design Principles
|
||||
|
||||
These tools embody:
|
||||
|
||||
**Composability**: Tools work together through pipes and command chaining
|
||||
|
||||
**Reliability**: Consistent interfaces and error handling
|
||||
|
||||
**Scriptability**: Non-interactive operation with clear outputs
|
||||
|
||||
**Maintainability**: Simple, focused implementations
|
||||
|
||||
**Testability**: Each tool can be tested in isolation
|
||||
|
||||
This approach makes the OmniXY installation and management system both powerful and maintainable while following time-tested Unix design principles.
|
||||
40
scripts/omnixy-backup-config
Executable file
40
scripts/omnixy-backup-config
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
# Unix-style config backup - does one thing well
|
||||
set -e
|
||||
|
||||
backup_config() {
|
||||
local backup_dir="${1:-}"
|
||||
local timestamp=$(date +%Y%m%d-%H%M%S)
|
||||
|
||||
# Default backup location
|
||||
if [[ -z "$backup_dir" ]]; then
|
||||
backup_dir="/etc/nixos.backup.$timestamp"
|
||||
fi
|
||||
|
||||
# Only backup if source exists
|
||||
if [[ ! -d /etc/nixos ]]; then
|
||||
[[ "${OMNIXY_QUIET:-}" != "1" ]] && echo "No existing configuration to backup"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Create backup
|
||||
sudo cp -r /etc/nixos "$backup_dir"
|
||||
|
||||
# Output backup location for piping/scripting
|
||||
echo "$backup_dir"
|
||||
}
|
||||
|
||||
main() {
|
||||
case "${1:-}" in
|
||||
--help|-h)
|
||||
echo "Usage: omnixy-backup-config [backup-directory]"
|
||||
echo "Backs up /etc/nixos to specified directory (or timestamped default)"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
backup_config "$1"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
||||
39
scripts/omnixy-build-system
Executable file
39
scripts/omnixy-build-system
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
# Unix-style system builder - does one thing well
|
||||
set -e
|
||||
|
||||
build_system() {
|
||||
local flake_path="${1:-/etc/nixos}"
|
||||
local config_name="${2:-omnixy}"
|
||||
|
||||
cd "$flake_path"
|
||||
|
||||
if [[ "${OMNIXY_QUIET:-}" == "1" ]]; then
|
||||
sudo nixos-rebuild switch --flake ".#$config_name" >/dev/null 2>&1
|
||||
else
|
||||
echo "Building system configuration..."
|
||||
sudo nixos-rebuild switch --flake ".#$config_name"
|
||||
echo "System build complete"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
case "${1:-}" in
|
||||
--help|-h)
|
||||
echo "Usage: omnixy-build-system [flake-path] [config-name]"
|
||||
echo "Builds and switches to NixOS configuration"
|
||||
echo "Default: /etc/nixos omnixy"
|
||||
exit 0
|
||||
;;
|
||||
--dry-run|-n)
|
||||
shift
|
||||
cd "${1:-/etc/nixos}"
|
||||
nixos-rebuild build --flake ".#${2:-omnixy}"
|
||||
;;
|
||||
*)
|
||||
build_system "$1" "$2"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
||||
47
scripts/omnixy-check-system
Executable file
47
scripts/omnixy-check-system
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
# Unix-style system checker - does one thing well
|
||||
set -e
|
||||
|
||||
# Check if running on NixOS
|
||||
check_nixos() {
|
||||
[ -f /etc/NIXOS ] || {
|
||||
echo "Not running on NixOS" >&2
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Check permissions (warn if root, but don't block)
|
||||
check_permissions() {
|
||||
if [ "$EUID" -eq 0 ]; then
|
||||
echo "Warning: Running as root is not recommended" >&2
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# Main check
|
||||
main() {
|
||||
case "${1:-}" in
|
||||
--nixos-only)
|
||||
check_nixos
|
||||
;;
|
||||
--permissions-only)
|
||||
check_permissions
|
||||
;;
|
||||
--quiet|-q)
|
||||
check_nixos >/dev/null 2>&1
|
||||
check_permissions >/dev/null 2>&1
|
||||
;;
|
||||
*)
|
||||
check_nixos
|
||||
check_permissions || true # Don't exit on root warning
|
||||
;;
|
||||
esac
|
||||
|
||||
# Output status for scripting
|
||||
if [[ "${OMNIXY_JSON:-}" == "1" ]]; then
|
||||
echo '{"nixos": true, "root": '$([ "$EUID" -eq 0 ] && echo "true" || echo "false")'}'
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
55
scripts/omnixy-configure-user
Executable file
55
scripts/omnixy-configure-user
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
# Unix-style user configuration - does one thing well
|
||||
set -e
|
||||
|
||||
configure_user() {
|
||||
local username="${1:-}"
|
||||
local config_file="${2:-/etc/nixos/configuration.nix}"
|
||||
local home_file="${3:-/etc/nixos/home.nix}"
|
||||
|
||||
# Get username if not provided
|
||||
if [[ -z "$username" ]]; then
|
||||
if [[ "${OMNIXY_QUIET:-}" == "1" ]]; then
|
||||
echo "Username required in quiet mode" >&2
|
||||
exit 1
|
||||
fi
|
||||
read -p "Username: " username
|
||||
fi
|
||||
|
||||
# Validate username
|
||||
if [[ ! "$username" =~ ^[a-zA-Z][a-zA-Z0-9_-]*$ ]]; then
|
||||
echo "Invalid username: $username" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Update configuration files
|
||||
if [[ -f "$config_file" ]]; then
|
||||
sudo sed -i "s/user = \"user\"/user = \"$username\"/" "$config_file"
|
||||
[[ "${OMNIXY_QUIET:-}" != "1" ]] && echo "Updated main configuration"
|
||||
fi
|
||||
|
||||
if [[ -f "$home_file" ]]; then
|
||||
sudo sed -i "s/home.username = \"user\"/home.username = \"$username\"/" "$home_file" 2>/dev/null || true
|
||||
sudo sed -i "s|home.homeDirectory = \"/home/user\"|home.homeDirectory = \"/home/$username\"|" "$home_file" 2>/dev/null || true
|
||||
[[ "${OMNIXY_QUIET:-}" != "1" ]] && echo "Updated home configuration"
|
||||
fi
|
||||
|
||||
# Output username for scripting
|
||||
echo "$username"
|
||||
}
|
||||
|
||||
main() {
|
||||
case "${1:-}" in
|
||||
--help|-h)
|
||||
echo "Usage: omnixy-configure-user [username] [config-file] [home-file]"
|
||||
echo "Updates configuration files with specified username"
|
||||
echo "Prompts for username if not provided (unless --quiet)"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
configure_user "$1" "$2" "$3"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
||||
42
scripts/omnixy-install-files
Executable file
42
scripts/omnixy-install-files
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
# Unix-style file installer - does one thing well
|
||||
set -e
|
||||
|
||||
install_files() {
|
||||
local source_dir="${1:-.}"
|
||||
local dest_dir="${2:-/etc/nixos}"
|
||||
|
||||
# Validate source
|
||||
[[ -d "$source_dir" ]] || {
|
||||
echo "Source directory '$source_dir' not found" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Create destination
|
||||
sudo mkdir -p "$dest_dir"
|
||||
|
||||
# Copy files
|
||||
sudo cp -r "$source_dir"/* "$dest_dir"/
|
||||
|
||||
# Set proper permissions
|
||||
sudo chown -R root:root "$dest_dir"
|
||||
sudo chmod 755 "$dest_dir"
|
||||
|
||||
[[ "${OMNIXY_QUIET:-}" != "1" ]] && echo "Files installed to $dest_dir"
|
||||
}
|
||||
|
||||
main() {
|
||||
case "${1:-}" in
|
||||
--help|-h)
|
||||
echo "Usage: omnixy-install-files [source-dir] [dest-dir]"
|
||||
echo "Copies configuration files from source to destination"
|
||||
echo "Default: current directory to /etc/nixos"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
install_files "$1" "$2"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user