Clean repository following Unix philosophy

- Remove deprecated installer scripts (install.sh, boot.sh, install-simple.sh)
- Remove large QCOW2 image files (12MB + 8MB)
- Remove outdated documentation files
- Remove deprecated omnixy scripts from scripts/ directory
- Update README.md with current implementation:
  - Document flake-based installation (recommended approach)
  - Add ISO building instructions
  - Update theme list (11 themes available)
  - Document pure Wayland architecture
  - Update project structure documentation
  - Remove references to deleted scripts
- Update .gitignore for GitHub:
  - Add Nix build outputs and ISO files
  - Add system and editor-specific files
  - Add large media files and archives
  - Add development environment files

This cleanup reduces repository size and focuses on the declarative
Nix flake approach, removing imperative installation scripts in favor
of standard NixOS tooling.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
theArctesian
2025-09-29 21:23:14 -07:00
parent 9c7772fe74
commit d45b690a1a
17 changed files with 247 additions and 2357 deletions

128
.gitignore vendored
View File

@@ -1 +1,129 @@
# Reference directories
./omarchy_ref/*
./omarchy/
# Nix build outputs
result
result-*
*.drv
# ISO and disk images
*.iso
*.qcow2
*.img
*.vdi
*.vmdk
# Build artifacts
*.o
*.so
*.a
*.out
build/
dist/
target/
# Temporary files
*.tmp
*.temp
*.swp
*.swo
*~
.#*
\#*#
# System files
.DS_Store
Thumbs.db
desktop.ini
# Editor and IDE files
.vscode/
.idea/
*.iml
.project
.classpath
.settings/
*.sublime-*
# Vim
*.vim
.vim/
Session.vim
.netrwhist
# Emacs
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
# Backup files
*.bak
*.backup
*.old
# Log files
*.log
logs/
*.log.*
# Cache directories
.cache/
cache/
__pycache__/
*.pyc
# Environment files
.env
.env.local
.env.*.local
# SSH keys and secrets
*.key
*.pem
id_rsa
id_rsa.pub
secrets/
# Large media files
*.mp4
*.avi
*.mov
*.mkv
*.zip
*.tar.gz
*.tar.xz
*.7z
*.rar
# Node modules (if any JavaScript projects)
node_modules/
# Python virtual environments
venv/
.venv/
env/
.env/
# Rust
Cargo.lock
# Go
vendor/
go.sum
# Claude Code
.claude/
# Hardware configuration (system-specific)
# Uncomment if you don't want to track hardware-configuration.nix
# hardware-configuration.nix
# Nix direnv
.direnv/
.envrc

View File

@@ -1,382 +0,0 @@
# Building OmniXY ISO Image
This guide explains how to build a live ISO image of OmniXY NixOS that can be used for installation or testing.
## Prerequisites
1. **NixOS or Nix with Flakes**: You need a system with Nix installed and flakes enabled
2. **Sufficient disk space**: Building an ISO requires several GB of space
3. **Good internet connection**: Initial build will download many packages
## Quick Start
### Method 1: Using the Built-in App (Recommended)
```bash
# Clone the repository
git clone https://github.com/TheArctesian/omnixy.git
cd omnixy
# Build the ISO using the built-in app
nix run .#build-iso
```
The built app will:
- Build the ISO image
- Show progress and final location
- Provide instructions for using the ISO
### Method 2: Direct Nix Build
```bash
# Build the ISO directly
nix build .#iso
# The ISO will be available as a symlink
ls -la ./result/iso/
```
### Method 3: Build Specific Configuration
```bash
# Build the ISO configuration specifically
nix build .#nixosConfigurations.omnixy-iso.config.system.build.isoImage
# Find the ISO file
find ./result -name "*.iso"
```
## ISO Features
The OmniXY ISO includes:
### Pre-installed Software
- **Desktop Environment**: Hyprland with full OmniXY theming
- **Development Tools**: Complete development stack (editors, compilers, etc.)
- **Multimedia**: Video players, image viewers, audio tools
- **Productivity**: Browsers, office suite, communication tools
- **System Tools**: Disk utilities, system monitors, network tools
### Live Session Features
- **Auto-login**: Boots directly to the desktop as `nixos` user
- **No password required**: Passwordless sudo for system administration
- **Network ready**: NetworkManager enabled for easy connection
- **Installation tools**: Graphical installer (Calamares) included
- **Theme showcase**: All OmniXY themes available for testing
### Installation Capabilities
- **Guided installation**: Run `omnixy-installer` for graphical setup
- **Manual installation**: Full NixOS installation tools available
- **Hardware support**: Wide hardware compatibility with latest kernel
## ISO Configuration Details
### Size and Performance
- **Expected size**: 3-5 GB (depending on included packages)
- **RAM requirements**: Minimum 4GB RAM for live session
- **Boot methods**: UEFI and BIOS supported
### Included Themes
All OmniXY themes are included and can be tested:
- tokyo-night (default)
- catppuccin
- gruvbox
- nord
- everforest
- rose-pine
- kanagawa
- catppuccin-latte
- matte-black
- osaka-jade
- ristretto
### Customization Options
#### Building with Different Default Theme
Edit `iso.nix` and change the theme import:
```nix
# Change this line:
./modules/themes/tokyo-night.nix
# To your preferred theme:
./modules/themes/gruvbox.nix
```
#### Excluding Packages
Modify the `omnixy.packages.exclude` section in `iso.nix`:
```nix
omnixy = {
# ... other config
packages = {
exclude = [ "discord" "spotify" "steam" ]; # Add packages to exclude
};
};
```
#### Adding Custom Packages
Add packages to the `environment.systemPackages` in `iso.nix`:
```nix
environment.systemPackages = with pkgs; [
# ... existing packages
your-custom-package
];
```
## Using the ISO
### Creating Bootable Media
#### USB Drive (Linux)
```bash
# Replace /dev/sdX with your USB device
sudo dd if=./result/iso/omnixy-*.iso of=/dev/sdX bs=4M status=progress oflag=sync
```
#### USB Drive (Windows)
Use tools like:
- Rufus
- Balena Etcher
- Windows USB/DVD Download Tool
#### DVD
Use any DVD burning software with the ISO file.
### Testing in Virtual Machine
#### QEMU
```bash
# Basic VM test (4GB RAM)
qemu-system-x86_64 -cdrom ./result/iso/omnixy-*.iso -m 4G -enable-kvm
# VM with more features
qemu-system-x86_64 \
-cdrom ./result/iso/omnixy-*.iso \
-m 8G \
-enable-kvm \
-vga virtio \
-display gtk,gl=on \
-machine q35 \
-cpu host
```
#### VirtualBox
1. Create new VM with Linux/Other Linux (64-bit)
2. Allocate at least 4GB RAM
3. Mount the ISO as CD/DVD
4. Enable hardware acceleration if available
#### VMware
1. Create new VM with Linux/Other Linux 5.x kernel 64-bit
2. Allocate at least 4GB RAM
3. Use ISO as CD/DVD source
4. Enable hardware acceleration
## Installation from ISO
### Using the Graphical Installer
1. Boot from the ISO
2. Wait for auto-login to complete
3. Run the installer:
```bash
omnixy-installer
```
4. Follow the graphical installation wizard
5. Reboot when complete
### Manual Installation
1. Boot from the ISO
2. Partition your disk with `gparted` or command-line tools
3. Mount your root partition:
```bash
sudo mount /dev/sdaX /mnt
```
4. Generate hardware configuration:
```bash
sudo nixos-generate-config --root /mnt
```
5. Download OmniXY:
```bash
cd /mnt/etc/nixos
sudo git clone https://github.com/TheArctesian/omnixy.git .
```
6. Edit configuration:
```bash
sudo nano configuration.nix
# Set your username and preferred theme
```
7. Install:
```bash
sudo nixos-install --flake /mnt/etc/nixos#omnixy
```
8. Set root password when prompted
9. Reboot
## Troubleshooting
### Build Issues
#### "Path does not exist" errors
Ensure all files are present and paths in configuration are correct:
```bash
# Check if all required files exist
ls -la modules/ packages/ assets/
```
#### Out of disk space
Building requires significant space:
```bash
# Clean up nix store
nix-collect-garbage -d
# Check available space
df -h
```
#### Network issues during build
Ensure internet connection and try with cached builds:
```bash
# Use substituters
nix build .#iso --substituters https://cache.nixos.org
```
### Boot Issues
#### ISO doesn't boot
- Verify BIOS/UEFI settings
- Try different USB creation method
- Check USB drive integrity
#### Black screen on boot
- Try different graphics settings in GRUB
- Add `nomodeset` kernel parameter
- Use safe graphics mode
#### Out of memory during live session
- Use system with more RAM (minimum 4GB)
- Close unnecessary applications
- Consider lighter package selection
### Installation Issues
#### Hardware not detected
- Ensure latest kernel is being used
- Check for firmware packages
- Update hardware-configuration.nix manually
#### Network issues during installation
- Test network in live session first
- Configure NetworkManager connections
- Check firewall settings
## Advanced Usage
### Building for Different Architectures
Currently, OmniXY ISO supports x86_64-linux. For other architectures:
```bash
# Check available systems
nix flake show
# Build for specific system (if supported)
nix build .#packages.aarch64-linux.iso
```
### Customizing Boot Parameters
Edit the ISO configuration to add custom kernel parameters:
```nix
# In iso.nix
boot.kernelParams = [
# Add your custom parameters
"custom.parameter=value"
];
```
### Creating Minimal ISO
For a smaller ISO, disable features in `iso.nix`:
```nix
omnixy = {
preset = "minimal"; # Instead of "everything"
packages.exclude = [ /* large packages */ ];
};
```
## CI/CD Integration
### GitHub Actions
Add to `.github/workflows/build-iso.yml`:
```yaml
name: Build ISO
on:
push:
tags: ['v*']
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
enable_flakes: true
- name: Build ISO
run: nix build .#iso
- name: Upload ISO
uses: actions/upload-artifact@v3
with:
name: omnixy-iso
path: result/iso/*.iso
```
### GitLab CI
Add to `.gitlab-ci.yml`:
```yaml
build-iso:
image: nixos/nix:latest
script:
- nix build .#iso
- cp result/iso/*.iso ./
artifacts:
paths:
- "*.iso"
expire_in: 1 week
only:
- tags
```
## Contributing
When modifying the ISO configuration:
1. Test builds locally before committing
2. Verify ISO boots in at least one VM
3. Test both UEFI and BIOS boot modes
4. Check that installation process works
5. Update documentation if adding new features
## Support
- **Issues**: Report problems on GitHub Issues
- **Discussions**: Join GitHub Discussions for questions
- **Documentation**: Check the main README.md for general info
- **Matrix/Discord**: Community chat (links in main README)
---
For more information about OmniXY, see the main [README.md](README.md) file.

View File

@@ -1,169 +0,0 @@
# 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.

245
README.md
View File

@@ -1,17 +1,18 @@
# OmniXY NixOS
Transform your NixOS installation into a fully-configured, beautiful, and modern development system based on Hyprland by running a single command. OmniXY brings the elegance of declarative configuration to desktop Linux, creating a reproducible and version-controlled development environment.
Transform your NixOS installation into a fully-configured, beautiful, and modern development system based on Hyprland. OmniXY brings the elegance of declarative configuration to desktop Linux, creating a reproducible and version-controlled development environment.
## ✨ Features
- **🎨 Beautiful Themes**: Ships with carefully crafted themes (Tokyo Night, Catppuccin, and more) - all declaratively configured
- **🚀 Modern Stack**: Hyprland compositor, Waybar, Alacritty, Neovim with LazyVim, all configured through Nix
- **🎨 Beautiful Themes**: Ships with 11 carefully crafted themes (Tokyo Night, Catppuccin, Gruvbox, Nord, and more) - all declaratively configured
- **🚀 Modern Stack**: Pure Wayland with Hyprland compositor, Waybar, Alacritty, Ghostty, Neovim with LazyVim
- **📦 Declarative Everything**: Entire system configuration as code - reproducible across machines
- **🛠️ Development Ready**: Pre-configured environments for Rust, Go, Python, Node.js, C/C++, and more via Nix shells
- **🔄 Atomic Updates**: Rollback capability, no broken states, system-wide updates with one command
- **🎯 Modular Design**: Feature flags for Docker, gaming, multimedia - enable only what you need
- **⚡ Flake-based**: Modern Nix flakes for dependency management and reproducible builds
- **🏠 Home Manager**: User environment managed declaratively alongside system configuration
- **💿 ISO Builder**: Build custom live ISOs with your configuration
## 📋 Requirements
@@ -22,42 +23,41 @@ Transform your NixOS installation into a fully-configured, beautiful, and modern
## 🚀 Installation
### Quick Install (Bootstrap on fresh NixOS)
### Direct Flake Installation (Recommended)
On an existing NixOS system:
```bash
curl -fsSL https://raw.githubusercontent.com/thearctesian/omnixy/main/boot.sh | bash
```
### Manual Installation
1. Clone this repository:
```bash
git clone https://github.com/thearctesian/omnixy
cd omnixy
```
2. Run the interactive installer:
```bash
./install.sh
```
3. The installer will:
- Backup your existing NixOS configuration
- Set up your username and home directory
- Let you choose a theme (Tokyo Night, Catppuccin, etc.)
- Configure optional features (Docker, gaming, multimedia)
- Build and switch to the new configuration
### Advanced: Direct Flake Installation
```bash
# On existing NixOS system
# Install directly from GitHub
sudo nixos-rebuild switch --flake github:thearctesian/omnixy#omnixy
# Or locally after cloning
# Or clone and install locally
git clone https://github.com/thearctesian/omnixy
cd omnixy
sudo nixos-rebuild switch --flake .#omnixy
```
### Building a Custom ISO
Build a live ISO with the OmniXY configuration:
```bash
# Clone the repository
git clone https://github.com/thearctesian/omnixy
cd omnixy
# Build the ISO (this will take time on first build)
nix build .#iso
# The ISO will be available at:
ls -la result/iso/
```
Write the ISO to a USB drive:
```bash
sudo dd if=result/iso/nixos-*.iso of=/dev/sdX bs=4M status=progress
```
## 🎮 Usage
### System Management
@@ -68,6 +68,7 @@ omnixy update # Update system and flake inputs
omnixy clean # Clean and optimize Nix store
omnixy info # Show system information
omnixy-rebuild # Rebuild system configuration
omnixy search <package> # Search for packages
```
### Theme Management
@@ -75,8 +76,19 @@ omnixy-rebuild # Rebuild system configuration
```bash
omnixy theme # List available themes
omnixy theme tokyo-night # Switch to Tokyo Night theme
omnixy-theme-list # List all available themes
omnixy-theme-set catppuccin # Set Catppuccin theme
# Available themes:
# - tokyo-night (default)
# - catppuccin
# - catppuccin-latte
# - gruvbox
# - nord
# - everforest
# - rose-pine
# - kanagawa
# - matte-black
# - osaka-jade
# - ristretto
```
### Development Environments
@@ -87,16 +99,15 @@ nix develop # Default development shell
nix develop .#rust # Rust development environment
nix develop .#python # Python development environment
nix develop .#node # Node.js development environment
nix develop .#go # Go development environment
nix develop .#c # C/C++ development environment
# Create new projects with dev environments
dev-project myapp rust # Create Rust project with flake
dev-project webapp node # Create Node.js project with flake
# Start development databases (Docker containers)
dev-postgres # PostgreSQL container
dev-redis # Redis container
dev-mysql # MySQL container
dev-mongodb # MongoDB container
# 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
```
### Package Management
@@ -114,10 +125,10 @@ omnixy-rebuild # Apply changes
| Key Combination | Action |
|-----------------|--------|
| `Super + Return` | Open terminal |
| `Super + B` | Open browser |
| `Super + Return` | Open terminal (Ghostty) |
| `Super + B` | Open browser (Firefox) |
| `Super + E` | Open file manager |
| `Super + D` | Application launcher |
| `Super + D` | Application launcher (Walker) |
| `Super + Q` | Close window |
| `Super + F` | Fullscreen |
| `Super + Space` | Toggle floating |
@@ -125,6 +136,7 @@ omnixy-rebuild # Apply changes
| `Super + Shift + 1-9` | Move window to workspace |
| `Print` | Screenshot region |
| `Shift + Print` | Screenshot full screen |
| `Super + L` | Lock screen |
## 📁 Project Structure
@@ -134,31 +146,43 @@ omnixy/
├── flake.nix # Flake definition with inputs/outputs
├── home.nix # Home-manager user configuration
├── hardware-configuration.nix # Hardware-specific configuration (generated)
├── install.sh # Interactive installer script
├── boot.sh # Bootstrap script for fresh systems
├── iso.nix # ISO image configuration
├── modules/ # Modular NixOS configuration
│ ├── core.nix # Core Omarchy options and settings
│ ├── core.nix # Core OmniXY options and settings
│ ├── packages.nix # Categorized package collections
│ ├── development.nix # Development tools and environments
│ ├── services.nix # System services and daemons
│ ├── users.nix # User account management
│ ├── boot.nix # Boot configuration
│ ├── security.nix # Security settings
│ ├── scripts.nix # OmniXY utility scripts
│ ├── menus.nix # Application launchers
│ ├── walker.nix # Walker launcher configuration
│ ├── fastfetch.nix # System info display
│ ├── desktop/
│ │ └── hyprland.nix # Hyprland compositor configuration
│ ├── themes/ # Declarative theme system
│ │ ├── tokyo-night.nix # Tokyo Night theme
│ │ ├── catppuccin.nix # Catppuccin theme
│ │ ├── gruvbox.nix # Gruvbox theme
│ │ └── ... # Additional themes
│ └── hardware/
── default.nix # Hardware support and drivers
└── packages/
── scripts.nix # Omarchy utility scripts as Nix packages
── default.nix # Common hardware support
│ ├── nvidia.nix # NVIDIA GPU support
── amd.nix # AMD GPU/CPU support
│ ├── intel.nix # Intel GPU/CPU support
│ ├── audio.nix # Audio configuration
│ ├── bluetooth.nix # Bluetooth support
│ └── touchpad.nix # Touchpad configuration
└── packages/ # Custom packages
└── scripts.nix # OmniXY utility scripts as Nix packages
```
## 🏗️ Architecture
### Flake-based Configuration
- **Pinned Dependencies**: All inputs locked for reproducibility
- **Multiple Outputs**: NixOS config, development shells, packages, and apps
- **Multiple Outputs**: NixOS configs, development shells, packages, apps, and ISO
- **Home Manager Integration**: User environment managed alongside system
### Modular Design
@@ -167,22 +191,29 @@ omnixy/
- **Hardware Support**: Automatic detection and configuration
- **Development Environments**: Language-specific shells with all dependencies
### Declarative Everything
- **No Imperative Commands**: Everything defined in configuration files
- **Version Controlled**: All changes tracked in git
- **Rollback Support**: Previous generations available for recovery
- **Atomic Updates**: System changes applied atomically
### Pure Wayland
- **No X11 Dependencies**: Full Wayland compositor stack
- **Hyprland**: Dynamic tiling compositor with animations
- **Native Wayland Apps**: Ghostty, Alacritty, Firefox with Wayland support
## 🎨 Themes
Omarchy includes beautiful themes that configure your entire desktop environment:
OmniXY includes beautiful themes that configure your entire desktop environment:
- **Tokyo Night** (default) - A clean, dark theme inspired by Tokyo's night lights
- **Catppuccin** - Soothing pastel theme with excellent contrast
- More themes coming soon: **Gruvbox**, **Nord**, **Everforest**, **Rose Pine**, **Kanagawa**
- **Tokyo Night** (default) - Clean, dark theme inspired by Tokyo's night lights
- **Catppuccin** - Soothing pastel theme (Mocha variant)
- **Catppuccin Latte** - Light variant of Catppuccin
- **Gruvbox** - Retro groove color scheme
- **Nord** - Arctic, north-bluish color palette
- **Everforest** - Comfortable green color scheme
- **Rose Pine** - Natural pine and rose colors
- **Kanagawa** - Inspired by Japanese paintings
- **Matte Black** - Pure black minimalist theme
- **Osaka Jade** - Jade green accents
- **Ristretto** - Coffee-inspired brown theme
Each theme declaratively configures:
- Terminal colors (Alacritty, Kitty)
- Terminal colors (Ghostty, Alacritty, Kitty)
- Editor themes (Neovim, VS Code)
- Desktop environment (Hyprland, Waybar, Mako)
- Applications (Firefox, BTtop, Lazygit)
@@ -192,41 +223,15 @@ Each theme declaratively configures:
### Adding System Packages
Edit `modules/packages.nix` and add packages to the appropriate category:
Edit `modules/packages.nix` and add packages to the appropriate category, then rebuild:
```nix
# In modules/packages.nix
environment.systemPackages = with pkgs; [
# Add your packages here
firefox
vscode
discord
] ++ optionals cfg.packages.categories.development [
# Development-specific packages
rustc
go
python3
];
```
Then rebuild:
```bash
omnixy-rebuild
```
### Adding User Packages
Edit `home.nix` for user-specific packages:
```nix
# In home.nix
home.packages = with pkgs; [
# User-specific packages
spotify
obs-studio
gimp
];
```
Edit `home.nix` for user-specific packages and rebuild.
### Creating Custom Themes
@@ -236,35 +241,8 @@ cp modules/themes/tokyo-night.nix modules/themes/my-theme.nix
```
2. Edit the color palette and application configurations
3. Update `configuration.nix` to use your theme:
```nix
currentTheme = "my-theme";
```
4. Rebuild to apply:
```bash
omnixy-rebuild
```
### Creating Development Environments
Add custom development shells to `flake.nix`:
```nix
devShells.${system}.myproject = pkgs.mkShell {
packages = with pkgs; [
nodejs_20
typescript
postgresql
];
shellHook = ''
echo "Welcome to My Project development environment!"
'';
};
```
Use with: `nix develop .#myproject`
3. Add to `flake.nix` theme list
4. Rebuild to apply
### Testing Changes
@@ -280,9 +258,28 @@ nixos-rebuild build-vm --flake .#omnixy
nix flake check
# Format Nix code
nixpkgs-fmt *.nix **/*.nix
nixpkgs-fmt *.nix modules/*.nix
```
## 🚀 Building ISOs
Build custom live ISOs with your configuration:
```bash
# Build ISO
nix build .#iso
# ISO location
ls result/iso/nixos-*.iso
```
The ISO includes:
- Full OmniXY desktop environment
- Auto-login live session
- Hyprland with selected theme
- Development tools
- Installation utilities
## 🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
@@ -306,10 +303,6 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
- Theme configurations adapted from community themes and color schemes
- [Nix Flakes](https://nixos.wiki/wiki/Flakes) - for reproducible and composable configurations
## 🔗 Similar Projects
- [Omarchy Nix](https://github.com/henrysipp/omarchy-nix) - Another NixOS implementation of DHH's Omarchy with automatic theme generation from wallpapers
## 🔗 Links
- [NixOS Manual](https://nixos.org/manual/nixos/stable/) - Official NixOS documentation
@@ -326,4 +319,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
---
Built with ❤️ using the power of **NixOS** and **declarative configuration**
Built with ❤️ using the power of **NixOS** and **declarative configuration**

View File

@@ -1,191 +0,0 @@
# 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.

80
boot.sh
View File

@@ -1,80 +0,0 @@
#!/usr/bin/env bash
# OmniXY NixOS Bootstrap Script
# Downloads and installs OmniXY on a fresh NixOS system
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
show_banner() {
echo -e "${BLUE}"
cat << 'EOF'
▄▄▄
▄█████▄ ▄███████████▄ ▄███████ ▄███████ ▄███████ ▄█ █▄ ▄█ █▄
███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███
███ ███ ███ ███ ███ ███ ███ ███ ███ ███ █▀ ███ ███ ███ ███
███ ███ ███ ███ ███ ▄███▄▄▄███ ▄███▄▄▄██▀ ███ ▄███▄▄▄███▄ ███▄▄▄███
███ ███ ███ ███ ███ ▀███▀▀▀███ ▀███▀▀▀▀ ███ ▀▀███▀▀▀███ ▀▀▀▀▀▀███
███ ███ ███ ███ ███ ███ ███ ██████████ ███ █▄ ███ ███ ▄██ ███
███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███
▀█████▀ ▀█ ███ █▀ ███ █▀ ███ ███ ███████▀ ███ █▀ ▀█████▀
███ █▀
NixOS Edition
Bootstrap Installer
EOF
echo -e "${NC}"
}
check_nixos() {
if [ ! -f /etc/NIXOS ]; then
echo -e "${RED}Error: This script must be run on NixOS${NC}"
exit 1
fi
}
main() {
show_banner
echo -e "${BLUE}Welcome to OmniXY NixOS Bootstrap!${NC}"
echo
check_nixos
# Install git if not present
if ! command -v git &> /dev/null; then
echo -e "${YELLOW}Installing git...${NC}"
nix-shell -p git --run true
fi
# Use custom repo if specified, otherwise default
OMNIXY_REPO="${OMNIXY_REPO:-TheArctesian/omnixy}"
OMNIXY_REF="${OMNIXY_REF:-main}"
echo -e "${BLUE}Cloning OmniXY from: https://github.com/${OMNIXY_REPO}.git${NC}"
# Remove existing directory
rm -rf ~/.local/share/omnixy/
# Clone repository
git clone "https://github.com/${OMNIXY_REPO}.git" ~/.local/share/omnixy
# Use custom branch if specified
if [[ $OMNIXY_REF != "main" ]]; then
echo -e "${GREEN}Using branch: $OMNIXY_REF${NC}"
cd ~/.local/share/omnixy
git fetch origin "${OMNIXY_REF}" && git checkout "${OMNIXY_REF}"
fi
cd ~/.local/share/omnixy
echo -e "${BLUE}Starting installation...${NC}"
./install.sh
}
main "$@"

View File

@@ -1,126 +0,0 @@
#!/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 "$@"

View File

@@ -1,668 +0,0 @@
#!/usr/bin/env bash
# OmniXY NixOS Installation Script
# Stylized installer with Tokyo Night theme integration
set -e
# Get terminal dimensions for centering
TERM_WIDTH=$(tput cols 2>/dev/null || echo 80)
TERM_HEIGHT=$(tput lines 2>/dev/null || echo 24)
# Tokyo Night Color Palette (using printf for better compatibility)
setup_colors() {
BG=$(printf '\033[48;2;26;27;38m') # #1a1b26
FG=$(printf '\033[38;2;192;202;245m') # #c0caf5
BLUE=$(printf '\033[38;2;122;162;247m') # #7aa2f7
CYAN=$(printf '\033[38;2;125;207;255m') # #7dcfff
GREEN=$(printf '\033[38;2;158;206;106m') # #9ece6a
YELLOW=$(printf '\033[38;2;224;175;104m') # #e0af68
RED=$(printf '\033[38;2;247;118;142m') # #f7768e
PURPLE=$(printf '\033[38;2;187;154;247m') # #bb9af7
ORANGE=$(printf '\033[38;2;255;158;100m') # #ff9e64
DARK_BLUE=$(printf '\033[38;2;65;72;104m') # #414868
# Special effects
BOLD=$(printf '\033[1m')
DIM=$(printf '\033[2m')
UNDERLINE=$(printf '\033[4m')
BLINK=$(printf '\033[5m')
RESET=$(printf '\033[0m')
CLEAR=$(printf '\033[2J')
CURSOR_HOME=$(printf '\033[H')
}
# Initialize colors
setup_colors
# Utility functions
center_text() {
local text="$1"
local width=${2:-$TERM_WIDTH}
# Strip ANSI codes for accurate length calculation
local clean_text=$(echo "$text" | sed 's/\x1b\[[0-9;]*m//g')
local padding=$(( (width - ${#clean_text}) / 2 ))
if [ $padding -gt 0 ]; then
printf "%*s%b\n" $padding "" "$text"
else
printf "%b\n" "$text"
fi
}
progress_bar() {
local progress=$1
local width=50
local filled=$((progress * width / 100))
local empty=$((width - filled))
printf "\r${BLUE}["
printf "%*s" $filled | tr ' ' '█'
printf "%*s" $empty | tr ' ' '░'
printf "] ${CYAN}%d%%${RESET}" $progress
}
animate_text() {
local text="$1"
local color="$2"
local delay=${3:-0.03}
for ((i=0; i<${#text}; i++)); do
printf "${color}%c" "${text:$i:1}"
sleep $delay
done
printf "${RESET}"
}
loading_spinner() {
local pid=$1
local message="$2"
local spinner='⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'
local i=0
while kill -0 $pid 2>/dev/null; do
printf "\r${CYAN}%c ${FG}%s${RESET}" "${spinner:$i:1}" "$message"
i=$(( (i+1) % ${#spinner} ))
sleep 0.1
done
printf "\r${GREEN}${FG}%s${RESET}\n" "$message"
}
# Set terminal background and clear
setup_terminal() {
printf "${CLEAR}${CURSOR_HOME}"
# Don't set background color as it may not work in all terminals
}
# Stylized banner with proper escaping
show_banner() {
clear
setup_terminal
# Add some vertical spacing
for ((i=0; i<3; i++)); do echo; done
# Main logo - using simpler ASCII that works better
echo
center_text "${CYAN}${BOLD} ██████╗ ███╗ ███╗███╗ ██╗██╗██╗ ██╗██╗ ██╗"
center_text "██╔═══██╗████╗ ████║████╗ ██║██║╚██╗██╔╝╚██╗ ██╔╝"
center_text "${BLUE}██║ ██║██╔████╔██║██╔██╗ ██║██║ ╚███╔╝ ╚████╔╝ "
center_text "██║ ██║██║╚██╔╝██║██║╚██╗██║██║ ██╔██╗ ╚██╔╝ "
center_text "${PURPLE}╚██████╔╝██║ ╚═╝ ██║██║ ╚████║██║██╔╝ ██╗ ██║ "
center_text " ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝ ╚═╝ ${RESET}"
echo
# Subtitle with typewriter effect
printf "%*s" $(( (TERM_WIDTH - 40) / 2 )) ""
animate_text "Welcome to the linux world" "$CYAN" 0.05
echo
echo
# Version and edition info
center_text "${DIM}${FG}NixOS Edition • Version 0.1 • Tokyo Night Theme${RESET}"
echo
# Decorative border
printf "%*s" $(( (TERM_WIDTH - 60) / 2 )) ""
printf "${DARK_BLUE}"
for ((i=0; i<60; i++)); do printf "═"; done
printf "${RESET}\n"
echo
}
# Stylized section headers
section_header() {
local title="$1"
local icon="$2"
local width=60
echo
printf "%*s" $(( (TERM_WIDTH - width) / 2 )) ""
printf "${BLUE}"
for ((i=0; i<width-2; i++)); do printf "─"; done
printf "${RESET}\n"
local header_text=" $icon $title"
local header_padding=$((width - 4 - ${#header_text}))
printf "%*s" $(( (TERM_WIDTH - width) / 2 )) ""
printf "${BLUE}${BOLD}${CYAN}%s%*s${BLUE}${RESET}\n" "$header_text" $header_padding ""
printf "%*s" $(( (TERM_WIDTH - width) / 2 )) ""
printf "${BLUE}"
for ((i=0; i<width-2; i++)); do printf "─"; done
printf "${RESET}\n"
echo
}
# Clear screen and show minimal context for user input
prepare_input_screen() {
local title="$1"
local subtitle="$2"
clear
setup_terminal
# Minimal header
echo
center_text "${CYAN}${BOLD}$title${RESET}"
if [[ -n "$subtitle" ]]; then
center_text "${DIM}${FG}$subtitle${RESET}"
fi
echo
}
# Enhanced user input with validation
get_input() {
local prompt="$1"
local default="$2"
local validator="$3"
while true; do
# Add some spacing before prompt
echo
center_text "${FG}$prompt${RESET}"
if [[ -n "$default" ]]; then
center_text "${DIM}(default: $default)${RESET}"
fi
printf "%*s${CYAN}${RESET}" $(( TERM_WIDTH / 2 - 2 )) ""
read -r input
input=${input:-$default}
if [[ -z "$validator" ]] || (eval "test_input='$input'; $validator"); then
echo "$input"
return
else
center_text "${RED}❌ Invalid input. Please try again.${RESET}"
fi
done
}
# Check functions with styled output
check_nixos() {
section_header "System Verification" "🔍"
printf "%*s${FG}Checking NixOS installation..." $(( (TERM_WIDTH - 35) / 2 )) ""
sleep 1
if [ ! -f /etc/NIXOS ]; then
printf "\r%*s${RED}❌ Not running on NixOS${RESET}\n" $(( (TERM_WIDTH - 25) / 2 )) ""
echo
center_text "${RED}${BOLD}ERROR: This installer requires NixOS${RESET}"
center_text "${FG}Please install NixOS first: ${UNDERLINE}https://nixos.org/download.html${RESET}"
echo
exit 1
else
printf "\r%*s${GREEN}✅ NixOS detected${RESET}\n" $(( (TERM_WIDTH - 20) / 2 )) ""
fi
printf "%*s${FG}Checking permissions..." $(( (TERM_WIDTH - 25) / 2 )) ""
sleep 0.5
if [ "$EUID" -eq 0 ]; then
printf "\r%*s${YELLOW}⚠️ Running as root${RESET}\n" $(( (TERM_WIDTH - 20) / 2 )) ""
echo
center_text "${YELLOW}Warning: Running as root is not recommended${RESET}"
center_text "${FG}It's safer to run as a regular user with sudo access${RESET}"
echo
echo
center_text "${CYAN}Continue anyway?${RESET}"
printf "%*s${CYAN}(y/N): ${RESET}" $(( (TERM_WIDTH - 10) / 2 )) ""
read -n 1 -r reply
echo
echo
if [[ ! $reply =~ ^[Yy]$ ]]; then
center_text "${FG}Installation cancelled${RESET}"
exit 1
fi
else
printf "\r%*s${GREEN}✅ User permissions OK${RESET}\n" $(( (TERM_WIDTH - 25) / 2 )) ""
fi
}
# Enhanced backup with progress
backup_config() {
if [ -d /etc/nixos ]; then
section_header "Configuration Backup" "💾"
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
BACKUP_DIR="/etc/nixos.backup.$TIMESTAMP"
center_text "${FG}Creating configuration backup${RESET}"
center_text "${DIM}${CYAN}$BACKUP_DIR${RESET}"
echo
# Simulate progress for visual appeal
for i in {1..20}; do
progress_bar $((i * 5))
sleep 0.05
done
echo
sudo cp -r /etc/nixos "$BACKUP_DIR" &
loading_spinner $! "Backing up existing configuration"
fi
}
# Installation with progress tracking
install_config() {
section_header "Installing Configuration" "📦"
center_text "${FG}Installing OmniXY configuration files...${RESET}"
echo
# Create directory
(sudo mkdir -p /etc/nixos && sleep 0.5) &
loading_spinner $! "Creating configuration directory"
# Copy files with progress simulation
(sudo cp -r ./* /etc/nixos/ && sleep 1) &
loading_spinner $! "Copying configuration files"
# Set permissions
(sudo chown -R root:root /etc/nixos && sudo chmod 755 /etc/nixos && sleep 0.5) &
loading_spinner $! "Setting file permissions"
}
# Enhanced user configuration
update_user() {
prepare_input_screen "OmniXY User Configuration" "Set up your user account"
local username
username=$(get_input "Enter your username" "user" '[[ "$test_input" =~ ^[a-zA-Z][a-zA-Z0-9_-]*$ ]]')
echo
center_text "${FG}Configuring system for user: ${CYAN}${BOLD}$username${RESET}"
echo
# Update configuration files
(sudo sed -i "s/user = \"user\"/user = \"$username\"/" /etc/nixos/configuration.nix && sleep 0.3) &
loading_spinner $! "Updating main configuration"
(sudo sed -i "s/home.username = \"user\"/home.username = \"$username\"/" /etc/nixos/home.nix 2>/dev/null && sleep 0.3) &
loading_spinner $! "Updating home configuration"
(sudo sed -i "s|home.homeDirectory = \"/home/user\"|home.homeDirectory = \"/home/$username\"|" /etc/nixos/home.nix 2>/dev/null && sleep 0.3) &
loading_spinner $! "Setting home directory"
}
# Stylized theme selection
select_theme() {
prepare_input_screen "OmniXY Theme Selection" "Choose your visual style"
local themes=(
"Tokyo Night - Dark theme with vibrant colors"
"Catppuccin - Pastel theme with modern aesthetics"
"Gruvbox - Retro theme with warm colors"
"Nord - Arctic theme with cool colors"
"Everforest - Green forest theme"
"Rose Pine - Cozy theme with muted colors"
"Kanagawa - Japanese-inspired theme"
"Catppuccin Latte - Light variant"
"Matte Black - Minimalist dark theme"
"Osaka Jade - Jade green theme"
"Ristretto - Coffee-inspired theme"
)
center_text "${BOLD}${PURPLE}Available Themes:${RESET}"
echo
# Display themes in organized layout
for i in "${!themes[@]}"; do
local num=$((i + 1))
if [ $num -le 9 ]; then
center_text "${BOLD}${CYAN} $num.${RESET} ${FG}${themes[$i]}"
else
center_text "${BOLD}${CYAN}$num.${RESET} ${FG}${themes[$i]}"
fi
done
echo
echo
# Clear instruction section
center_text "${BOLD}${YELLOW}Instructions:${RESET}"
center_text "${FG}Enter the number of your preferred theme${RESET}"
center_text "${DIM}Press Enter to use the default (Tokyo Night)${RESET}"
echo
# Create visible input box
printf "%*s" $(( (TERM_WIDTH - 40) / 2 )) ""
printf "${BLUE}╭──────────────────────────────────────╮${RESET}\n"
printf "%*s" $(( (TERM_WIDTH - 40) / 2 )) ""
printf "${BLUE}${RESET}"
printf "%*s${FG}Theme Selection${RESET}%*s" 12 "" 12 ""
printf "${BLUE}${RESET}\n"
printf "%*s" $(( (TERM_WIDTH - 40) / 2 )) ""
printf "${BLUE}├──────────────────────────────────────┤${RESET}\n"
printf "%*s" $(( (TERM_WIDTH - 40) / 2 )) ""
printf "${BLUE}${RESET}%*s${CYAN}Enter choice (1-11):${RESET}%*s" 7 "" 7 ""
printf "${BLUE}${RESET}\n"
printf "%*s" $(( (TERM_WIDTH - 40) / 2 )) ""
printf "${BLUE}${RESET}%*s${DIM}Default: 1${RESET}%*s" 13 "" 13 ""
printf "${BLUE}${RESET}\n"
printf "%*s" $(( (TERM_WIDTH - 40) / 2 )) ""
printf "${BLUE}╰──────────────────────────────────────╯${RESET}\n"
printf "%*s${CYAN}${RESET}" $(( TERM_WIDTH / 2 - 2 )) ""
# Get input with validation
local theme_choice
while true; do
read -r theme_choice
theme_choice=${theme_choice:-1}
if [[ "$theme_choice" =~ ^([1-9]|1[01])$ ]]; then
break
else
printf "%*s${RED}❌ Please enter a number between 1 and 11${RESET}\n" $(( (TERM_WIDTH - 45) / 2 )) ""
printf "%*s${CYAN}${RESET}" $(( TERM_WIDTH / 2 - 2 )) ""
fi
done
local theme_names=("tokyo-night" "catppuccin" "gruvbox" "nord" "everforest" "rose-pine" "kanagawa" "catppuccin-latte" "matte-black" "osaka-jade" "ristretto")
local selected_theme=${theme_names[$((theme_choice - 1))]}
echo
center_text "${GREEN}✅ Selected theme: ${CYAN}${BOLD}$selected_theme${RESET}"
echo
(sudo sed -i "s/currentTheme = \".*\"/currentTheme = \"$selected_theme\"/" /etc/nixos/configuration.nix && sleep 0.5) &
loading_spinner $! "Applying theme configuration"
}
# Feature configuration
configure_features() {
section_header "Feature Configuration" "⚙️ "
center_text "${FG}Configure optional features:${RESET}"
echo
# Security features
center_text "${BOLD}${PURPLE}Security Features:${RESET}"
echo
center_text "${FG}Enable fingerprint authentication?${RESET}"
printf "%*s${CYAN}(y/N): ${RESET}" $(( (TERM_WIDTH - 10) / 2 )) ""
read -n 1 -r reply
echo
if [[ $reply =~ ^[Yy]$ ]]; then
center_text "${GREEN}✅ Fingerprint authentication enabled${RESET}"
local config_dir="/etc/nixos"
if [ "$INSTALL_MODE" = "fresh" ]; then
config_dir="/mnt/etc/nixos"
fi
sudo sed -i 's/fingerprint = {/fingerprint = {\n enable = true;/' "$config_dir/configuration.nix"
fi
echo
center_text "${FG}Enable FIDO2 security keys?${RESET}"
printf "%*s${CYAN}(y/N): ${RESET}" $(( (TERM_WIDTH - 10) / 2 )) ""
read -n 1 -r reply
echo
if [[ $reply =~ ^[Yy]$ ]]; then
center_text "${GREEN}✅ FIDO2 authentication enabled${RESET}"
local config_dir="/etc/nixos"
if [ "$INSTALL_MODE" = "fresh" ]; then
config_dir="/mnt/etc/nixos"
fi
sudo sed -i 's/fido2 = {/fido2 = {\n enable = true;/' "$config_dir/configuration.nix"
fi
echo
center_text "${BOLD}${BLUE}Development Features:${RESET}"
echo
center_text "${FG}Enable Docker support?${RESET}"
printf "%*s${CYAN}(y/N): ${RESET}" $(( (TERM_WIDTH - 10) / 2 )) ""
read -n 1 -r reply
echo
if [[ $reply =~ ^[Yy]$ ]]; then
center_text "${GREEN}✅ Docker support enabled${RESET}"
# Add Docker configuration
fi
echo
center_text "${BOLD}${YELLOW}Gaming Features:${RESET}"
echo
center_text "${FG}Enable gaming support (Steam, Wine)?${RESET}"
printf "%*s${CYAN}(y/N): ${RESET}" $(( (TERM_WIDTH - 10) / 2 )) ""
read -n 1 -r reply
echo
if [[ $reply =~ ^[Yy]$ ]]; then
center_text "${GREEN}✅ Gaming support enabled${RESET}"
# Add gaming configuration
fi
}
# Hardware configuration generation
generate_hardware_config() {
section_header "Hardware Configuration" "🔧"
if [ ! -f /etc/nixos/hardware-configuration.nix ]; then
center_text "${FG}Generating hardware-specific configuration...${RESET}"
echo
(sudo nixos-generate-config --root / && sleep 1) &
loading_spinner $! "Scanning hardware configuration"
else
center_text "${YELLOW}⚠️ Hardware configuration already exists${RESET}"
center_text "${DIM}${FG}Skipping hardware generation...${RESET}"
sleep 1
fi
}
# System building with enhanced progress
build_system() {
section_header "System Build" "🏗️ "
center_text "${YELLOW}${BOLD}⚠️ IMPORTANT NOTICE ⚠️${RESET}"
center_text "${FG}This process may take 10-45 minutes depending on your system${RESET}"
center_text "${FG}A stable internet connection is required${RESET}"
echo
echo
center_text "${CYAN}${BOLD}Continue with system build?${RESET}"
printf "%*s${CYAN}(Y/n): ${RESET}" $(( (TERM_WIDTH - 10) / 2 )) ""
read -n 1 -r reply
echo
echo
if [[ $reply =~ ^[Nn]$ ]]; then
center_text "${YELLOW}Build postponed. Run this command later:${RESET}"
center_text "${CYAN}sudo nixos-rebuild switch --flake /etc/nixos#omnixy${RESET}"
return
fi
echo
center_text "${FG}Building NixOS system configuration...${RESET}"
center_text "${DIM}${FG}This includes downloading packages and compiling the system${RESET}"
echo
# Start build in background and show spinner
sudo nixos-rebuild switch --flake /etc/nixos#omnixy &
local build_pid=$!
# Enhanced progress indication
local dots=""
local build_messages=(
"Downloading Nix packages..."
"Building system dependencies..."
"Compiling configuration..."
"Setting up services..."
"Finalizing installation..."
)
local msg_index=0
local counter=0
while kill -0 $build_pid 2>/dev/null; do
if (( counter % 30 == 0 && msg_index < ${#build_messages[@]} )); then
echo
center_text "${CYAN}${build_messages[$msg_index]}${RESET}"
((msg_index++))
fi
printf "\r%*s${CYAN}Building system" $(( (TERM_WIDTH - 20) / 2 )) ""
dots+="."
if [ ${#dots} -gt 6 ]; then dots=""; fi
printf "%s${RESET}" "$dots"
sleep 1
((counter++))
done
wait $build_pid
local exit_code=$?
echo
if [ $exit_code -eq 0 ]; then
center_text "${GREEN}${BOLD}✅ System build completed successfully!${RESET}"
else
center_text "${RED}${BOLD}❌ Build failed with errors${RESET}"
center_text "${FG}Check the output above for details${RESET}"
exit $exit_code
fi
}
# Completion screen
show_complete() {
clear
setup_terminal
# Add spacing
for ((i=0; i<2; i++)); do echo; done
# Success banner
printf "%*s${GREEN}${BOLD}" $(( (TERM_WIDTH - 60) / 2 )) ""
echo "╭──────────────────────────────────────────────────────────╮"
printf "%*s${GREEN}" $(( (TERM_WIDTH - 60) / 2 )) ""
printf "%*s🎉 OmniXY Installation Complete! 🎉%*s│\n" 14 "" 14 ""
printf "%*s${GREEN}╰──────────────────────────────────────────────────────────╯${RESET}\n" $(( (TERM_WIDTH - 60) / 2 )) ""
echo
echo
# Quick start section
section_header "Quick Start Guide" "🚀"
center_text "${CYAN}${BOLD}Essential Commands:${RESET}"
center_text "${FG}${DIM}Run these commands to get started${RESET}"
echo
center_text "${CYAN}omnixy-menu${RESET} ${FG}- Interactive system menu${RESET}"
center_text "${CYAN}omnixy-info${RESET} ${FG}- System information display${RESET}"
center_text "${CYAN}omnixy-theme${RESET} ${FG}- Switch between themes${RESET}"
center_text "${CYAN}omnixy-security${RESET} ${FG}- Configure security features${RESET}"
echo
section_header "Keyboard Shortcuts" "⌨️ "
center_text "${PURPLE}${BOLD}Hyprland Window Manager:${RESET}"
echo
center_text "${CYAN}Super + Return${RESET} ${FG}- Open terminal${RESET}"
center_text "${CYAN}Super + R${RESET} ${FG}- Application launcher${RESET}"
center_text "${CYAN}Super + B${RESET} ${FG}- Web browser${RESET}"
center_text "${CYAN}Super + E${RESET} ${FG}- File manager${RESET}"
center_text "${CYAN}Super + Q${RESET} ${FG}- Close window${RESET}"
echo
section_header "Next Steps" "📋"
center_text "${YELLOW}${BOLD}Recommended Actions:${RESET}"
echo
center_text "${FG}1. ${CYAN}Reboot your system${RESET} ${FG}- Apply all changes${RESET}"
center_text "${FG}2. ${CYAN}Run omnixy-security status${RESET} ${FG}- Check security setup${RESET}"
center_text "${FG}3. ${CYAN}Configure fingerprint/FIDO2${RESET} ${FG}- Enhanced security${RESET}"
center_text "${FG}4. ${CYAN}Explore themes${RESET} ${FG}- Try different color schemes${RESET}"
echo
center_text "${BLUE}${UNDERLINE}https://github.com/TheArctesian/omnixy${RESET} ${FG}- Project homepage${RESET}"
echo
center_text "${DIM}${FG}Thank you for choosing OmniXY! ${CYAN}❤️${RESET}"
echo
# Auto-reboot prompt
echo
center_text "${YELLOW}${BOLD}Reboot now to complete installation?${RESET}"
printf "%*s${CYAN}(Y/n): ${RESET}" $(( (TERM_WIDTH - 10) / 2 )) ""
read -n 1 -r reply
echo
echo
if [[ ! $reply =~ ^[Nn]$ ]]; then
center_text "${GREEN}Rebooting in 3 seconds...${RESET}"
sleep 1
center_text "${GREEN}Rebooting in 2 seconds...${RESET}"
sleep 1
center_text "${GREEN}Rebooting in 1 second...${RESET}"
sleep 1
sudo reboot
else
center_text "${FG}Remember to reboot when convenient!${RESET}"
fi
}
# Main installation orchestrator
main() {
# Trap to restore terminal on exit
trap 'printf "\033[0m\033[?25h"; stty sane 2>/dev/null || true' EXIT
# Hide cursor during installation
printf '\033[?25l'
show_banner
sleep 2
section_header "Welcome to OmniXY" "🌟"
center_text "${FG}Transform your NixOS into a beautiful, modern desktop experience${RESET}"
center_text "${DIM}${FG}This installer will guide you through the complete setup process${RESET}"
echo
echo
center_text "${CYAN}${BOLD}Ready to begin installation?${RESET}"
printf "%*s${CYAN}(Y/n): ${RESET}" $(( (TERM_WIDTH - 10) / 2 )) ""
read -n 1 -r reply
echo
echo
if [[ $reply =~ ^[Nn]$ ]]; then
center_text "${FG}Installation cancelled. Come back anytime!${RESET}"
exit 0
fi
# Installation flow with enhanced UX
check_nixos
backup_config
install_config
generate_hardware_config
update_user
select_theme
configure_features
build_system
show_complete
# Restore cursor
printf '\033[?25h'
}
# Start the installation
main "$@"

Binary file not shown.

Binary file not shown.

View File

@@ -1,277 +0,0 @@
# 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.

View File

@@ -1,40 +0,0 @@
#!/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 "$@"

View File

@@ -1,39 +0,0 @@
#!/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 "$@"

View File

@@ -1,47 +0,0 @@
#!/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 "$@"

View File

@@ -1,55 +0,0 @@
#!/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 "$@"

View File

@@ -1,42 +0,0 @@
#!/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 "$@"

View File

@@ -1,115 +0,0 @@
#!/usr/bin/env bash
# Quick ISO build test script
set -e
echo "🧪 OmniXY ISO Build Test"
echo "========================"
echo ""
# Check if we're in the right directory
if [ ! -f "flake.nix" ] || [ ! -f "iso.nix" ]; then
echo "❌ Error: Must be run from the OmniXY project root directory"
echo " Expected files: flake.nix, iso.nix"
exit 1
fi
# Check if nix is available
if ! command -v nix &> /dev/null; then
echo "❌ Error: Nix is not installed or not in PATH"
exit 1
fi
# Check flakes support
if ! nix --help | grep -q flakes; then
echo "❌ Error: Nix flakes not enabled"
echo " Add 'experimental-features = nix-command flakes' to nix.conf"
exit 1
fi
echo "✅ Environment checks passed"
echo ""
# Test flake evaluation
echo "🔍 Testing flake evaluation..."
if nix flake check --no-build 2>/dev/null; then
echo "✅ Flake configuration is valid"
else
echo "⚠️ Flake check warnings (this is usually fine for ISO builds)"
fi
echo ""
# Test ISO configuration evaluation
echo "🔍 Testing ISO configuration..."
if nix eval .#nixosConfigurations.omnixy-iso --apply 'config: "ISO config loads successfully"' &>/dev/null; then
echo "✅ ISO configuration evaluates successfully"
else
echo "❌ ISO configuration has evaluation errors"
echo " Try: nix eval .#nixosConfigurations.omnixy-iso --show-trace"
exit 1
fi
echo ""
# Estimate build requirements
echo "📊 Build Requirements:"
echo " • Disk space: ~10-15 GB during build, ~3-5 GB for final ISO"
echo " • RAM: Recommended 8+ GB (minimum 4 GB)"
echo " • Time: 30-60 minutes on first build (varies by system)"
echo " • Network: Several GB of downloads on first build"
echo ""
# Ask if user wants to proceed with actual build
read -p "🚀 Do you want to proceed with building the ISO? (y/N): " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "🏗️ Starting ISO build..."
echo " This may take a while. Press Ctrl+C to cancel."
echo ""
# Start the build with progress
if nix build .#iso --print-build-logs; then
echo ""
echo "✅ ISO build completed successfully!"
# Find and display the ISO
if [ -L "./result" ]; then
iso_path=$(readlink -f ./result)
iso_file=$(find "$iso_path" -name "*.iso" | head -1)
if [ -n "$iso_file" ]; then
iso_size=$(du -h "$iso_file" | cut -f1)
echo "📁 ISO Location: $iso_file"
echo "📏 ISO Size: $iso_size"
echo ""
echo "🚀 Next steps:"
echo " • Test in VM: qemu-system-x86_64 -cdrom '$iso_file' -m 4G -enable-kvm"
echo " • Flash to USB: sudo dd if='$iso_file' of=/dev/sdX bs=4M status=progress"
echo " • See BUILD_ISO.md for complete documentation"
else
echo "⚠️ ISO file not found in build result"
fi
else
echo "⚠️ Build result symlink not found"
fi
else
echo ""
echo "❌ ISO build failed"
echo " Check the error messages above for details"
echo " Common solutions:"
echo " • Free up disk space: nix-collect-garbage -d"
echo " • Check internet connection"
echo " • Try again (builds can sometimes fail on first attempt)"
exit 1
fi
else
echo "🛑 Build cancelled. You can run this test anytime with:"
echo " ./test-iso-build.sh"
echo ""
echo "To build manually:"
echo " nix build .#iso"
echo " nix run .#build-iso"
fi
echo ""
echo "📚 For more information, see BUILD_ISO.md"