nix-homelab
This homelab entirelly managed by NixOS
All the configuration is stored on homelab.json
file, you can do:
- Define network CIDR
- Define hosts
- Define the roles installed for selected hosts
- Define services descriptions
- etc ...
This documentation is generated from homelab.json
file content
Roles
The main roles used in this home lab
This list generated with inv docs.all-pages
command
Logo | Module | Hosts | Description |
---|---|---|---|
wireguard | router-living, badphone | An VPN client/server alternative to IPSec and OpenVPN | |
acme | rpi40, bootstore | Let's Encrypt Automatic Certificate Management Environment | |
coredns | rpi40 | A Go DNS server, it used for serving local hosts and alias | |
ntp | rpi40, bootstore | Network Time Protocol | |
mosquitto | rpi40 | A mqtt broker [service port 1883] | |
zigbee2mqtt | rpi40 | A zigbee2mqtt [service port 8080] | |
adguard | bootstore | DNS ad blocker [service port 3002] | |
dashy | bootstore | The Ultimate Homepage for your Homelab [service port 8081] | |
grafana | bootstore | The open and composable observability and data visualization platform [service port 3000] | |
loki | bootstore | Scalable log aggregation system [service port 8084,9095] | |
nfs | bootstore | A Linux NFS server, it used for backuping a servers and Latops | |
nix-serve | bootstore | For caching the nix build results | |
prometheus | bootstore | Monitoring system and time series database [service port 9090] | |
smokeping | bootstore | Latency measurement tool | |
statping | bootstore | A Status Page for monitoring your websites and applications with beautiful graphs [service port 8082] | |
uptime | bootstore | A Status Page [service port 3001/8083] | |
home-assistant | bootstore | Open source home automation [service port 8123] |
User programs
Logo | Name | Description |
---|---|---|
Neovim | Moved to badele/vide |
Hosts
List of hosts composing the home lab
This list generated with inv docs.all-pages
command
Logo | Name | OS | Description |
---|---|---|---|
box (192.168.0.1) | Sagem | SFR internet box | |
router-living (192.168.254.254) | MikroTik | Livingroom home mikrotik router | |
router-bedroom (192.168.254.253) | MikroTik | Bedroom home mikrotik router | |
router-homeoffice (192.168.254.252) | MikroTik | Office home mikrotik router | |
sam (192.168.0.18) | NixOS | Samsung N110 Latop | |
latino (192.168.254.200) | NixOS | Dell Latitude E5540 Latop | |
rpi40 (192.168.254.101) | NixOS | The Raspberry PI 4 storage server | |
bootstore (192.168.254.100) | NixOS | HP Proliant Microserver N40L storage server | |
badwork (192.168.254.189) | Nix | A work thinkpad | |
badwork-eth (192.168.254.102) | Nix | A ethernet work thinkpad | |
badphone (192.168.254.194) | Android | Bruno's phone | |
ladphone (192.168.254.184) | Android | Lucas's phone | |
sadphone (192.168.254.188) | Android | Steph's phone | |
loadphone (192.168.254.199) | Iphone | Lou's phone | |
tv-chromecast (192.168.254.105) | Chromecast | TV Chromecast | |
bedroom-googlemini-A (192.168.254.197) | GoogleMini | Google Mini room A | |
bedroom-googlemini-C (192.168.254.196) | GoogleMini | Google Mini room C | |
badxps (192.168.254.114) | NixOS | Dell XPS 9570 Latop | |
bridge-hue (192.168.254.191) | Bridge | Philips Hue bridge | |
sadhome (192.168.254.185) | ArchLinux | Stephanie's laptop |
Network
graph BT
linkStyle default interpolate basis
internet((Internet))
box[<center>SFR internet box</br>192.168.0.1</center>]---internet
router-living[<center>Livingroom mikrotik router</br>192.168.254.254</center>]---box
router-ladbedroom[<center>Bedroom mikrotik router</br>192.168.254.253</center>]---router-living
router-homeoffice[<center>Office mikrotik router</br>192.168.254.252</center>]---router-living
latino[<center>Dell E5540 Latop</br>192.168.254.200</center>]---router-ladbedroom
rpi40[<center>The RPI 4 server</br>192.168.254.101</center>]---router-homeoffice
bootstore[<center>HP Microserver N40L server</br>192.168.254.100</center>]---router-homeoffice
badwork[<center>A work thinkpad</br>192.168.254.189</center>]---router-ladbedroom
badwork-eth[<center>A ethernet work thinkpad</br>192.168.254.102</center>]---router-homeoffice
badphone[<center>Bruno's phone</br>192.168.254.194</center>]---router-ladbedroom
ladphone[<center>Lucas's phone</br>192.168.254.184</center>]---router-ladbedroom
sadphone[<center>Steph's phone</br>192.168.254.188</center>]---router-ladbedroom
loadphone[<center>Lou's phone</br>192.168.254.199</center>]---router-ladbedroom
tv-chromecast[<center>TV Chromecast</br>192.168.254.105</center>]---router-ladbedroom
bedroom-googlemini-A[<center>Google Mini room A</br>192.168.254.197</center>]---router-ladbedroom
bedroom-googlemini-C[<center>Google Mini room C</br>192.168.254.196</center>]---router-ladbedroom
badxps[<center>Dell XPS 9570 Latop</br>192.168.254.114</center>]---router-ladbedroom
bridge-hue[<center>Philips Hue bridge</br>192.168.254.191</center>]---router-ladbedroom
sadhome[<center>Stephanie's laptop</br>192.168.254.185</center>]---router-ladbedroom
subgraph livingroom
box
router-living
tv-chromecast
sadhome
end
subgraph ladbedroom
router-ladbedroom
bridge-hue
end
subgraph homeoffice
router-homeoffice
latino
rpi40
bootstore
badwork
badwork-eth
badxps
end
subgraph badbedroom
bedroom-googlemini-A
end
subgraph loadbedroom
bedroom-googlemini-C
end
Structure
- Configuration
homelab.json
: main homelab file configuration (roles servers, network, etc)hosts
: hosts configuration (system, hardware, host secrets)*.nix
: user accounts
users
: users configuration (on user environment, user secrets)
- System
nix
: all *.nix fileshome-manager
: All users *.nix files (installed on user environment)modules
: all nix moduleshome-manager
: user modulesnixos
: nixos modules (installed on system wide)host.nix
: host options (custom options for host)
nixos
: all *.nix files installed on system wideoverlays
: overlays nix derivationspkgs
: custom nix packages
Homelab initialisation
inv init.domain-cert
NixOS installation & update
Update from you local computer/laptop
# Local installation
inv nixos.[build|test|deploy]
inv home.[build|test|deploy]
# Remote installation
inv nixos.[build|test|deploy] --hostnames <hostname>,<hostname>,...
inv home.[build|test|deploy] --username <username> --hostnames <hostname>,<hostname>,...
Update roles or multiple hosts
# Simulate deployment(build)
inv role.build --role <rolename>
inv nixos.build --hosts <hostname>,<hostname>
# Install
inv role.deploy --role <rolename>
inv nixos.deploy --hosts <hostname>,<hostname>
Commands
Home lab commands list
This list generated with inv docs.all-pages
command
Available tasks:
docs.all-pages generate all homelab documentation
docs.host-pages generate all homelab hosts page
docs.main-page generate main homelab page
docs.scan-all-hosts Retrieve all hosts system infromations
home.build Test to <hostnames> server
home.deploy Deploy to <hostnames> server
home.test Test to <hostnames> server
init.disk-format Format disks with zfs
init.disk-mount Mount disks from the installer
init.domain-cert Init domain certificate
init.nix-serve Init nix binary cache server <hostname> nix-
serve private & public key
init.nixos-generate-config Generate hardware configuration for the host
init.nixos-install install nixos
init.ssh-init-host-key Init ssh host key from nixos installation
nixos.build Test to <hostnames> server
nixos.deploy Deploy to <hostnames> server
nixos.test Test to <hostnames> server
role.build Build for all hosts contains the role
role.deploy Deploy for all hosts contains the role
role.test Test for all hosts contains the role
A big thanks ❤️
A big thank to the contributors of OpenSource projects in particular :
- doctor-cluster-config from German TUM School of Computation
- Mic92 and for his some nix contributions
- Misterio77 and for his some nix contributions
- longerHV nix configuration file