Modern dotfiles repository managed with Chezmoi, featuring Fish shell configuration and automated setup scripts.
π Full documentation: https://dotfiles.ravensberg.org
- Multi-Shell Support: Configurations for Fish, Bash, Zsh (Linux/macOS) and PowerShell (Windows) with unified aliases and custom functions
- Git Configuration: Pre-configured with templates for user info and global ignore patterns
- Editor Configurations: Vim and Tmux with sensible defaults
- Cross-Platform: Works seamlessly on Linux, macOS, Windows (PowerShell), and WSL
- Custom Functions Library: Reusable shell functions for common tasks (git operations, brew updates, file management)
- Automated Validation: Pre-commit hooks and validation scripts ensure configuration quality
- Windows Enterprise Detection: Automatic detection of Entra ID (Azure AD) and Intune enrollment status
- Task Automation: Integrated Task runner for common operations (validation, testing, installation)
- Tool Version Management: mise for managing development tool versions
The dotfiles repository provides several variables that can be used in templates and scripts:
firstname/lastname/name- Your name (prompted on first run)username- System username (prompted on first run)email- Your email address (prompted on first run)githubUsername- Your GitHub username (auto-detected from email or git remote)
codespaces- Running in GitHub Codespaces (true/false)devcontainer- Running in a dev container (true/false)wsl- Running in Windows Subsystem for Linux (true/false)ci- Running in CI environment (true/false)installType- Installation mode (lightorfull)
isEntraIDJoined- Device is Entra ID (Azure AD) joined (true/false)isIntuneJoined- Device is Intune (MDM) enrolled (true/false)isEntraRegistered- Device is Entra ID registered/workplace joined (true/false)isADDomainJoined- Device is Active Directory domain joined (true/false)entraIDTenantName- Entra ID tenant name (e.g.,Microsoft)entraIDTenantId- Entra ID tenant ID (GUID)isWork- Device is joined to a*Microsofttenant (true/false)
These variables are automatically exposed as environment variables in your shell:
- PowerShell:
$env:CHEZMOI_*(e.g.,$env:CHEZMOI_IS_ENTRA_ID_JOINED,$env:CHEZMOI_ENTRA_ID_TENANT_NAME) - Bash/Zsh:
$CHEZMOI_*(e.g.,$CHEZMOI_IS_ENTRA_ID_JOINED,$CHEZMOI_ENTRA_ID_TENANT_NAME) - Fish:
$CHEZMOI_*(e.g.,$CHEZMOI_IS_ENTRA_ID_JOINED,$CHEZMOI_ENTRA_ID_TENANT_NAME)
dotfiles/
βββ .devcontainer/ # DevContainer configuration
β βββ devcontainer.json # Container features and settings
βββ .github/
β βββ workflows/
β β βββ ci.yaml # CI/CD pipeline with devcontainer tests
β βββ scripts/
β βββ test-devcontainer.sh # DevContainer deployment test
β βββ test-light-server.sh # Light installation test
β βββ test-dev-server.sh # Full installation test
βββ install.sh # Wrapper script for Coder support (Unix)
βββ install.ps1 # Wrapper script for Coder support (Windows)
βββ home/ # Chezmoi source directory
β βββ dot_config/ # XDG config directory (~/.config/)
β β βββ fish/ # Fish shell configuration (Linux/macOS)
β β β βββ config.fish # Main Fish config
β β β βββ conf.d/ # Configuration snippets (auto-loaded)
β β β β βββ aliases.fish # Command aliases
β β β βββ functions/ # Custom Fish functions
β β β β βββ fish_greeting.fish
β β β β βββ git_undo_commit.fish
β β β βββ completions/ # Custom completions
β β βββ powershell/ # PowerShell configuration (Windows)
β β β βββ profile.ps1 # Main PowerShell profile
β β β βββ aliases.ps1 # Command aliases
β β β βββ modules/ # PowerShell modules
β β β β βββ DotfilesHelpers/ # Custom functions module
β β β βββ scripts/ # PowerShell utility scripts
β β β βββ New-SigningCert.ps1.tmpl # Create code signing certificate
β β β βββ Import-SigningCert.ps1 # Import certificate
β β β βββ Sign-PowerShellScripts.ps1 # Sign PowerShell scripts
β β βββ git/ # Git configuration
β β β βββ config.tmpl # Git config with templating
β β β βββ ignore # Global gitignore
β β βββ shell/ # Other shell configs (bash, zsh)
β β βββ config.bash
β β βββ config.zsh
β β βββ functions/ # Shared shell functions
β βββ AppData/ # Windows-specific application data
β β βββ Local/Packages/
β β βββ Microsoft.WindowsTerminal_.../
β β βββ LocalState/
β β βββ settings.json # Windows Terminal settings
β βββ Documents/ # Windows PowerShell profiles
β β βββ PowerShell/
β β β βββ profile.ps1
β β βββ WindowsPowerShell/
β β βββ profile.ps1
β βββ dot_bashrc # Bash configuration
β βββ dot_zshrc # Zsh configuration
β βββ dot_vimrc # Vim configuration
β βββ dot_tmux.conf # Tmux configuration
β βββ install.sh # Main installation script (Unix)
β βββ install.ps1 # Main installation script (Windows)
βββ tests/ # Test files (Bats/Pester)
β βββ bash/ # Bats tests for validation
β β βββ validate-chezmoi.bats
β β βββ validate-shell-scripts.bats
β β βββ validate-fish-config.bats
β β βββ test-chezmoi-apply.bats
β β βββ test-fish-config.bats
β β βββ verify-dotfiles.bats
β β βββ run-tests.sh # Bats test runner
β βββ powershell/ # Pester tests
β βββ Validate-Packages.Tests.ps1
β βββ Invoke-PesterTests.ps1 # Pester test runner
βββ README.md
βββ CONTRIBUTING.md
βββ STRUCTURE.md
βββ .lefthook.toml
sh -c "$(curl -fsLS https://get.chezmoi.io)" -- init --apply DevSecNinjaOr clone and install locally:
git clone https://github.com/DevSecNinja/dotfiles.git
cd dotfiles
./install.shOption 1: Direct from GitHub (PowerShell 5.1+ or PowerShell 7+)
# Using the official chezmoi installer (recommended)
(irm -useb https://get.chezmoi.io/ps1) | powershell -c -; chezmoi init --apply DevSecNinjaOption 2: Clone and install locally
git clone https://github.com/DevSecNinja/dotfiles.git
cd dotfiles
.\install.ps1Use the Linux installation method inside your WSL distribution:
sh -c "$(curl -fsLS https://get.chezmoi.io)" -- init --apply DevSecNinjaThe dotfiles will automatically detect WSL and apply appropriate configurations.
This repository supports Coder workspaces out of the box. The install.sh and install.ps1 scripts in the repository root will be automatically discovered and executed by Coder when setting up a new workspace with dotfiles enabled.
To use this dotfiles repository in Coder:
- Navigate to your Coder workspace settings
- Enable dotfiles support
- Set the dotfiles repository URL to:
https://github.com/DevSecNinja/dotfiles - Coder will automatically run
install.sh(Linux/macOS) orinstall.ps1(Windows) during workspace setup
For more information, see the Coder Dotfiles Documentation.
This repository includes a complete DevContainer configuration for Visual Studio Code and GitHub Codespaces. The devcontainer provides a fully configured development environment with:
Pre-installed Features:
- πΊ Homebrew package manager
- π¦ Git LFS (Large File Storage)
- π» PowerShell with Pester testing framework
- π Python (latest version)
- π GitHub CLI
Automatic Setup:
- β
Dotfiles automatically installed via
postCreateCommand - β Fish shell configured as default terminal
- β All configurations applied and verified
- β VSCode extensions pre-installed (GitHub Copilot, Pester)
Prebuilt Images:
- π Prebuilt devcontainer images are automatically built and published to GitHub Container Registry
- ποΈ Images are rebuilt weekly and on every devcontainer configuration change
- β‘ CI workflows use prebuilt images for faster test execution
- π Package release notes are available inside the container at
/usr/local/share/dotfiles-devcontainer/release-notes.md - π The full package manifest is available at
/usr/local/share/dotfiles-devcontainer/manifest.md - π¦ Available at:
ghcr.io/devsecninja/dotfiles-devcontainer:latest - π The compressed image storage size per platform is published in the exported release notes (
## Image sizesection) and the build job summary for every prebuild run - Current
latestsize is ~884 MB compressed forlinux/amd64and ~942 MB forlinux/arm64(docker buildx imagetools inspect), with ~2.0 GB local unpacked size forlinux/amd64.
Using the DevContainer:
-
In VSCode:
- Open this repository in VSCode
- Install the "Dev Containers" extension
- Click "Reopen in Container" when prompted
- Or use Command Palette:
Dev Containers: Reopen in Container
-
In GitHub Codespaces:
- Navigate to this repository on GitHub
- Click "Code" β "Codespaces" β "Create codespace on main"
- The devcontainer will automatically build and configure
- Optional: Enable Codespaces prebuilds in repository settings for even faster startup
-
Testing the DevContainer:
# Run the devcontainer test script .github/scripts/test-devcontainer.sh
Reusing the prebuilt image in another project:
Point a consuming repository's devcontainer.json at the prebuilt image and add
a postCreateCommand that trusts and installs that project's own mise tools:
{
"image": "ghcr.io/devsecninja/dotfiles-devcontainer:latest",
"postCreateCommand": "mise trust --all --yes && mise install",
"remoteUser": "vscode"
}mise trust --all --yes non-interactively trusts the workspace's mise config
(untrusted by default in a fresh container) so mise install picks up the
project's pinned tools. See docs/installation.md for details.
The CI pipeline automatically tests the complete devcontainer deployment, including feature installation, dotfiles setup, and postCreateCommand execution.
On first run, Chezmoi will prompt for:
- Name: Used in Git commits
- Email: Used in Git commits
To re-enter this information:
chezmoi init --data=false# Check what changes would be applied
chezmoi diff
# Apply changes
chezmoi apply
# Edit a file
chezmoi edit ~/.vimrc
# Add a new file
chezmoi add ~/.config/myapp/config.yaml
# Update from repository
chezmoi update
# View Chezmoi data (name, email, OS info)
chezmoi data
# Verify all managed files
chezmoi verifyThis repository uses lefthook for code quality checks:
# Install development tools (lefthook, shellcheck, shfmt, ...) via mise
mise install
# Setup lefthook git hooks (from repository root)
home/.chezmoiscripts/linux/run_once_setup-lefthook.sh
# Run manually on all files
lefthook run pre-commit --all-filesHooks will automatically run on git commit. The checks include:
- π Shell script linting (shellcheck)
- π¨ Shell script formatting (shfmt)
- π§ Executable bit enforcement on shell scripts
These scripts and hooks are also used in the GitHub Actions CI pipeline to ensure quality.
This repository includes Task and mise for streamlined development:
Task provides convenient commands for common operations:
# List all available tasks
task --list
# Install all dependencies (mise, go-task, Python packages)
task install:all
# Run all validation checks (required before commit)
task validate:all
# Run specific validations
task validate:chezmoi # Validate Chezmoi config
task validate:shell # Validate shell scripts
task validate:fish # Validate Fish config
# Run tests
task test:all # All tests
task test:chezmoi-apply # Test Chezmoi apply
# Chezmoi operations
task chezmoi:init # Preview changes (dry-run)
task chezmoi:diff # Show differences
task chezmoi:verify # Verify applied files
# Development setup
task dev:setup # Complete dev environment setup
# CI tasks
task ci:validate # Run CI validation pipelineMise manages tool versions defined in .mise.toml:
# Install mise-managed tools
mise install
# Show installed tools
mise list
# Upgrade all tools
mise upgrade
# Check mise configuration
mise doctorFull mode installations automatically install both Task and mise. Light mode installs only mise.
The repository supports two installation modes:
- Light mode (servers, CI, codespaces): Essential tools only
- Full mode (dev servers, workstations): Full development tooling including Task and mise
The mode is auto-detected based on:
- Hostname patterns (SVLDEV* = full, SVL* = light)
- Environment (codespaces, devcontainer, CI = light)
- Default = full mode
To change modes:
chezmoi init --data=falseFeel free to fork and customize this repository for your own needs!
MIT