Automated Arch Linux installation and configuration for DevOps, Cloud Engineering, and Development
This repository provides a complete, automated solution for installing and configuring Arch Linux on the Lenovo Legion Y520 laptop, optimized for professional DevOps and development work. The setup includes GPU switching (NVIDIA Optimus), security hardening, containerization tools, and comprehensive documentation.
| Method | Description | Time Required |
|---|---|---|
| Manual | Step-by-step installation following guides | 2-3 hours |
| Archinstall | Semi-automated installation with config files | 1-2 hours |
| PACUSER Suite | Fully automated post-installation setup | 30-45 min |
- ✅ NVIDIA Optimus - Automatic GPU switching (Intel/NVIDIA)
- ✅ Lenovo Legion Y520 - Full hardware support
- ✅ Hybrid Graphics - Power saving and performance modes
- ✅ Legacy GPU Support - Pascal, Maxwell architectures
- ✅ UFW Firewall - Pre-configured DevOps rules
- ✅ Fail2Ban - SSH brute-force protection
- ✅ GNOME Keyring - Secure credential storage
- ✅ System Hardening - DevOps-optimized sysctl
- ✅ Docker & Docker Compose - With NVIDIA runtime
- ✅ Kubernetes - kubectl, helm, k9s, kubectx
- ✅ PostgreSQL - Database with remote access
- ✅ VSCode & Windsurf - AI-powered IDEs
- ✅ Node.js + pnpm, Python + UV
- ✅ TLP & Intel Undervolt - Power management
- ✅ ZRAM - Memory compression
- ✅ BBR + CAKE - Network optimization
- ✅ Custom kernel tuning - DevOps-optimized
archlegion/
├── README.md # This file
├── pacmaster.sh # Main orchestrator wrapper
│
├── archinstall/ # 🏗️ Archinstall configurations
│ ├── README.md # Archinstall usage guide
│ ├── user_configuration.json # System config
│ ├── user_credentials.json # User credentials (template)
│ └── partition_preset.json # Disk partitioning preset
│
├── config/ # ⚙️ Configuration files
│ ├── pacuser.conf # Main configuration
│ ├── starship.toml # Starship prompt config
│ └── dotfiles/ # Shell and app configs
│
├── scripts/ # 📜 Installation scripts
│ ├── pacmaster.sh # Real orchestrator
│ ├── 00_chroot_setup.sh # Base system setup
│ ├── 01_desktop_install.sh # Desktop & drivers
│ ├── 02_yay_optimus.sh # AUR & Optimus Manager
│ ├── 03_system_tuning.sh # Tuning & security
│ ├── 04_software_setup.sh # DevOps software
│ ├── 05_extras_setup.sh # Shell & extras
│ ├── 99_safe_reboot_check.sh # Pre-reboot verification
│ └── lib/ # Shared libraries
│
└── docs/ # 📚 Documentation
├── README.md # Main installation guide
├── 01-desktop.md # Desktop environment setup
├── 02-utils.md # System utilities & optimizations
├── 03-software.md # Software installation
└── software/ # Software-specific guides
├── postgress.md # PostgreSQL installation
├── postgress_tips.md # PostgreSQL management
├── gnome_keyring.md # GNOME Keyring setup
├── droid_cam.md # Virtual webcam
└── rclone.md # Google Drive mount
Follow the comprehensive installation guide:
# 1. Read the main installation guide
cat docs/README.md
# 2. Follow the step-by-step installation process
# - Base Arch Linux installation
# - Desktop environment setup
# - System utilities and optimizations
# - Software installationUse the pre-configured archinstall files:
# 1. Boot from Arch Linux ISO
# 2. Connect to internet
# 3. Copy archinstall configuration files
cp archinstall/*.json /root/archinstall/
# 4. Edit credentials
nano /root/archinstall/user_credentials.json
# 5. Run archinstall
archinstall --config /root/archinstall/user_configuration.json \
--creds /root/archinstall/user_credentials.json
# 3. After first boot, run PACUSER
./pacmaster.shSee archinstall/README.md for detailed instructions.
After base Arch Linux installation, run the automated suite:
# 1. Clone this repository
git clone https://github.com/ciroautuori/archlegion.git
cd archlegion
# 2. Configure your settings
cp config/pacuser.conf config/pacuser.conf.local
nano config/pacuser.conf.local
# 3. Run the orchestrator
./pacmaster.shThe PACUSER suite automates all post-installation steps including desktop setup, system tuning, security configuration, and software installation.
| Document | Description |
|---|---|
| Main Installation Guide | Complete Arch Linux installation |
| Desktop Setup | KDE/XFCE, NVIDIA, Optimus Manager |
| System Utilities | Zsh, optimizations, power management |
| Software Setup | Applications, Steam, VirtualBox |
| Document | Description |
|---|---|
| PostgreSQL Installation | Database setup with remote access |
| PostgreSQL Management | Users, databases, and roles |
| GNOME Keyring | Secure credential storage |
| Virtual Webcam | DroidCam setup |
| Rclone | Google Drive mount |
| File | Description |
|---|---|
| pacuser.conf | Main configuration file |
| starship.toml | Starship prompt theme |
| archinstall config | Archinstall configurations |
- KDE Plasma - Modern, feature-rich desktop
- XFCE - Lightweight alternative
- NVIDIA Drivers - Proprietary with Optimus support
- PipeWire Audio - Modern audio stack
- Display Manager - SDDM (KDE) or LightDM (XFCE)
- UFW Firewall - Pre-configured DevOps rules
- Fail2Ban - SSH brute-force protection
- GNOME Keyring - Secure password storage
- System Hardening - DevOps-optimized sysctl
- Docker - With NVIDIA runtime support
- Docker Compose - Multi-container applications
- Kubernetes Tools - kubectl, helm, k9s
- Google Cloud SDK - GCP management
- VSCode - Visual Studio Code
- Windsurf - AI-powered IDE
- Git - Version control with aliases
- Node.js + pnpm - JavaScript development
- Python + UV - Python development
- TLP - Advanced power management
- Intel Undervolt - CPU/GPU undervolting
- ZRAM - Memory compression
- BBR + CAKE - Network optimization
- Steam - Gaming platform
- Proton - Windows game compatibility
- NVIDIA Optimus - GPU switching
- GameMode - Performance optimization
Edit config/pacuser.conf to customize your installation:
# System settings
PACUSER_HOSTNAME="archlinux"
PACUSER_USERNAME="yourname"
PACUSER_TIMEZONE="Europe/Rome"
# Docker settings
PACUSER_DOCKER_ROOT="/var/lib/docker"
PACUSER_DOCKER_NVIDIA="1"
# Graphics settings
PACUSER_OPTIMUS_MODE="hybrid"
PACUSER_ENABLE_OPTIMUS_MANAGER="0"
# Power management
PACUSER_ENABLE_UNDERVOLT="1"
PACUSER_UNDERVOLT_CPU="-80"
# Security
PACUSER_ENABLE_UFW="1"
PACUSER_ENABLE_FAIL2BAN="1"
# IDEs
PACUSER_INSTALL_IDES="vscode windsurf"See Configuration Guide for all available options.
After installation, run these checks:
# Check GPU
nvidia-smi
optimus-manager --status
# Check Docker
docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
# Check PostgreSQL
sudo -u postgres psql -c "SELECT version();"
# Check Firewall
sudo ufw status
# Check Services
systemctl status tlp
systemctl status docker# Run PACUSER test suite
cd scripts/tests
./run_tests.sh| Issue | Solution |
|---|---|
| NVIDIA not detected | Reboot after driver installation |
| Optimus Manager not working | Check optimus-manager --status |
| Docker requires sudo | Add user to docker group |
| Firewall blocking connections | Check sudo ufw status |
| PostgreSQL not starting | Check sudo journalctl -u postgresql |
For detailed troubleshooting, see the Troubleshooting Guide.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
If this project helped you set up your Arch Linux workstation, consider giving it a star!
For issues and questions:
- Open an issue on GitHub
- Check the documentation
- Review troubleshooting guides
Made with ❤️ for the Arch Linux community