Complete workstation setup for DevOps, Cloud Engineering, and Development
This repository contains a comprehensive guide to install and configure Arch Linux on the Lenovo Legion Y520 laptop. The setup is optimized for professional development work with full GPU support (NVIDIA Optimus), security hardening, and DevOps tools.
This repository is organized into several sections covering different aspects of the installation and configuration:
| Document | Description |
|---|---|
README.md |
Base Arch Linux installation (this document) |
01-desktop.md |
Desktop environment (Xorg, XFCE/KDE, NVIDIA, Optimus Manager) |
02-utils.md |
System utilities, Zsh, optimizations, power management |
03-software.md |
Essential applications, Steam, VirtualBox, Wine |
| Document | Description |
|---|---|
software/postgress.md |
PostgreSQL installation and remote access |
software/postgress_tips.md |
PostgreSQL users, databases, and roles management |
software/gnome_keyring.md |
GNOME Keyring for secure password storage |
software/droid_cam.md |
Virtual webcam setup with DroidCam |
software/rclone.md |
Rclone with Google Drive mount |
The PACUSER scripts are located in the ../scripts/ directory. Run the main orchestrator with ./pacmaster.sh for automated post-installation setup.
- NVIDIA Optimus - Automatic GPU switching (Intel/NVIDIA)
- Lenovo Legion Y520 - Full hardware support
- Hybrid Graphics - Power saving and performance modes
- UFW Firewall - Pre-configured DevOps rules
- Fail2Ban - SSH brute-force protection
- GNOME Keyring - Secure credential storage
- Docker & Docker Compose - Containerization with NVIDIA runtime
- Kubernetes - kubectl, helm, k9s, kubectx
- PostgreSQL - Database server with remote access
- VSCode & Windsurf - AI-powered IDEs
- TLP & Intel Undervolt - Power management
- ZRAM - Memory compression
- BBR + CAKE - Network optimization
- Custom kernel tuning - DevOps-optimized sysctl
Follow the step-by-step guide below for a complete manual installation.
Use the PACUSER v2.0 suite for automated post-installation:
cd ../pacuser
cp app/config/pacuser.conf app/config/pacuser.conf.local
nano app/config/pacuser.conf.local # Customize your settings
./pacmaster.shBefore starting the installation, ensure you have:
- A bootable Arch Linux USB drive
- An active internet connection
- Backup of any important data from the device (installation will wipe all data on the disk)
- Access to UEFI/BIOS settings to boot from USB
Set the keyboard layout to Italian (or your preferred layout):
loadkeys itSynchronize the system clock with NTP and set timezone:
timedatectl set-ntp true
timedatectl set-timezone Europe/RomeUse cfdisk to create the following partitions on /dev/nvme0n1:
| Partition | Size | Type |
|---|---|---|
| EFI | 512MB | EFI System |
| Swap | 4GB | Linux swap |
Root (/) |
50GB | Linux filesystem |
Home (/home) |
Remaining | Linux filesystem |
cfdisk /dev/nvme0n1mkfs.fat -F32 /dev/nvme0n1p1 # EFI Partition
mkswap /dev/nvme0n1p2 # Swap Partition
swapon /dev/nvme0n1p2 # Activate swap
mkfs.ext4 /dev/nvme0n1p3 # Root Partition
mkfs.ext4 /dev/nvme0n1p4 # Home Partitionmount /dev/nvme0n1p3 /mnt
mkdir /mnt/home
mount /dev/nvme0n1p4 /mnt/home
mkdir -p /mnt/boot/efi
mount /dev/nvme0n1p1 /mnt/boot/efipacstrap /mnt base base-devel linux linux-firmware linux-headers intel-ucode nano git networkmanager
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt /bin/bashln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime
hwclock --systohcnano /etc/locale.gen # Uncomment it_IT.UTF-8 UTF-8
locale-gen
echo "LANG=it_IT.UTF-8" > /etc/locale.confecho "KEYMAP=it" > /etc/vconsole.confecho "archlegion" > /etc/hostnamenano /etc/hostsAdd:
127.0.0.1 localhost
::1 localhost
127.0.1.1 archlegion.localdomain archlegion
passwduseradd -m -G wheel,storage,power,audio,video,users -s /bin/bash username
passwd username
echo "username ALL=(ALL) ALL" | EDITOR=nano visudopacman -S grub efibootmgr dosfstools mtools --noconfirm
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfgsystemctl enable NetworkManagerexit
umount -R /mnt
rebootAfter rebooting, follow these guides for a complete setup:
-
Desktop Environment - See
01-desktop.md- Install Xorg and KDE Plasma/XFCE
- Configure NVIDIA drivers and Optimus Manager
- Set up display manager
-
System Utilities - See
02-utils.md- Configure Zsh with Oh My Zsh
- Install system optimizations
- Set up power management (TLP, Intel Undervolt)
- Configure firewall (UFW) and Fail2Ban
-
Software Installation - See
03-software.md- Install essential applications
- Set up Steam and VirtualBox
- Configure Wine for Windows applications
-
Automated Setup - Use PACUSER v2.0
cd ../pacuser ./pacmaster.sh
The system includes UFW firewall with DevOps-optimized rules:
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22/tcp # SSH
sudo ufw allow 80/tcp # HTTP
sudo ufw allow 443/tcp # HTTPS
sudo ufw enablesudo pacman -S fail2ban --noconfirm
sudo systemctl enable fail2ban
sudo systemctl start fail2banFor secure password storage, see software/gnome_keyring.md.
Complete PostgreSQL setup with remote access configuration:
- Installation Guide:
software/postgress.md - Management Tips:
software/postgress_tips.md
Quick setup:
sudo pacman -S postgresql
sudo -u postgres initdb --locale it_IT.UTF-8 -D /var/lib/postgres/data
sudo systemctl start postgresql
sudo systemctl enable postgresqlSet up a virtual webcam using DroidCam:
sudo pacman -S v4l2loopback-dkms linux-headers
yay -S droidcamSee software/droid_cam.md for complete configuration.
Mount Google Drive with Rclone:
sudo pacman -S rclone
rclone configSee software/rclone.md for detailed setup instructions.
Switch between Intel (power saving) and NVIDIA (performance) GPUs:
optimus-manager --switch intel # Power saving
optimus-manager --switch nvidia # Performanceyay -S steam- TLP - Advanced power management
- Intel Undervolt - CPU/GPU undervolting
- ZRAM - Memory compression
See 02-utils.md for complete optimization guide.
nvidia-smi # Check GPU status
optimus-manager --status # Check current GPU mode
sudo reboot # Required after driver changessudo usermod -aG docker $USER
newgrp dockersudo ufw status numbered # Check firewall
sudo systemctl status NetworkManager- Arch Linux Wiki
- Lenovo Legion Linux
- Main README - Repository overview
MIT License - See LICENSE for details.
If this guide helped you set up your Arch Linux workstation, consider giving it a star on GitHub!