Skip to content

gradiuscypher/homelab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

homelab

My homelab and hosting stuff.

TODO

  • Use tf to build temporary VPS hosts

Infrastructure Management

This repository uses Terraform to manage Incus containers across different hosts.

Directory Structure

  • dev/: Development environment configuration targeting incus-server.
  • prd/: Production environment configuration targeting shell.grds.io.
  • grds.io/: Reusable Terraform modules.

Prerequisites

  1. Incus installed and configured.
  2. Terraform installed.
  3. Remotes added to your local Incus config:
    incus remote add incus-server <address>
    incus remote add shell.grds.io <address>

Usage

Navigate to the environment directory and initialize Terraform:

terraform init
terraform apply

Ansible Configuration

This repository uses Ansible to manage system configuration and firewall rules.

Setup

  1. Encrypt Secrets: The ansible/inventory/group_vars/prd/vault.yml file contains sensitive information like home IP addresses. It must be encrypted before commit:
    cd ansible
    ansible-vault encrypt inventory/group_vars/prd/vault.yml
  2. Running Playbooks: To apply configurations:
    ansible-playbook site.yml --ask-vault-pass

Developer Machines

Dev machines are provisioned with Terraform and configured with Ansible. They feature a pre-configured development environment including Neovim (LazyVim), Docker, and common CLI tools.

Creating a New Dev Host

Follow these steps to provision and configure a new development environment:

  1. Add the Host to Terraform: Edit terraform/dev-machines/dev_containers.yml and add a new entry under containers:

    containers:
      - name: my-new-dev-box
        image: images:ubuntu/24.04/cloud
  2. Provision with Terraform: Apply the changes to create the Incus container:

    cd terraform/dev-machines
    terraform apply

    Note: By default, this uses a pre-configured SSH key. To use a different one, run terraform apply -var="ssh_public_key=$(cat ~/.ssh/id_rsa.pub)".

  3. Configure with Ansible: Run the specific dev playbook to install tools and sync your Neovim configuration. Ansible automatically discovers the new host via the Incus dynamic inventory.

    cd ansible
    ansible-playbook dev.yml

What's Included

  • Neovim: A full LazyVim setup with:
    • CodeCompanion: AI-powered coding assistant (configured for OpenRouter).
    • Catppuccin Theme: High-quality color scheme.
    • Core Tools: ripgrep, fzf, fd, jq, unzip, etc.
  • Language Support: Python (venv, uv) and Node.js (npm, pnpm) pre-installed.
  • AI Tools: opencode pre-installed.
  • System: Automatic package updates and a dedicated gradius user.

About

My homelab stuff.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors