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