My Home-Lab as Code
BEWARE! This project is in MEGA flux atm as I migrate most things to
nix/.
Welcome to my home-lab!
This is my personal project to setup all my r/self-hosted services in my home-lab.
The goal of this repo is to be able to survive a dooms-day scenario where all of my hosts die, and I can use to use this repo to be able to re-create it all with ease.
The flow is simple. First provision a VM with tofu.
Then deploy the configuration with nix.
The manage.sh script can do the full flow for you while prompting you to verify
prior to applying changes to real infra.
This is a monorepo with the following structure:
# Definitions for my Proxmox VMs, and LXC (legacy)
├── terraform/
# Configurations for my VMs
├── nix/
# (DEPRECATED) Configurations for my VMs
├── ansible/
...
Example run:
❯ ./manage.sh
=== home-lab manager ===
1) add a new host
2) update an existing host
3) update all hosts
4) update base image + template
q) quit
> 2
Hosts:
1) caldav
2) git
3) monitoring-2
4) photos
5) rproxy-2
6) s3
7) torrents-2
Host name/number: 3
Deploy action [switch/boot, default switch]:
→ [monitoring-2] Host keys match, no action needed
→ [monitoring-2] Deploying with nixos-rebuild...
warning: Git tree '/home/kdam0/projects/home-lab' is dirty
building the system configuration...
warning: Git tree '/home/kdam0/projects/home-lab' is dirty
copying 0 paths...
Checking switch inhibitors... done
updating GRUB 2 menu...
activating the configuration...
setting up /etc...
reloading user units for jefe...
restarting the following user units: nixos-activation.service
restarting sysinit-reactivation.target
the following new units were started: sysinit-reactivation.target, systemd-tmpfiles-resetup.service
Done. The new configuration is /nix/store/2s6jq4jhvrhxzv5h73qvb0z1qyi05nkr-nixos-system-monitoring-2-26.11.20260910.8ce4ef6
=== home-lab manager ===
1) add a new host
2) update an existing host
3) update all hosts
4) update base image + template
q) quit
> q
