• Stars
    star
    102
  • Rank 326,601 (Top 7 %)
  • Language
    Nix
  • License
    GNU General Publi...
  • Created over 1 year ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Homelab and dotfiles made with NixOS

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 files
      • home-manager: All users *.nix files (installed on user environment)
      • modules: all nix modules
        • home-manager: user modules
        • nixos: nixos modules (installed on system wide)
          • host.nix: host options (custom options for host)
      • nixos: all *.nix files installed on system wide
      • overlays: overlays nix derivations
      • pkgs: custom nix packages

Homelab initialisation

inv init.domain-cert

NixOS installation & update

See Commons installation

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 :

More Repositories

1

gitcheck

Check multiple git repository in one pass / Vérifiez vos dépôt git en une seule passe
Python
174
star
2

archlinux-auto-install

Automatically install archlinux (from livecd with Ventoy tools)
Shell
37
star
3

vide

Neovim custom configuration, oriented for DevOps role (bash, go, json, python, terraform, typescript, etc ...). not empty code :)
Lua
25
star
4

je-n-ai-pas-oublie

A lire avant d'aller voter :)
25
star
5

docker-dotfiles

A I3 desktop with Vim IDE editor and some terminal tools in docker container
Python
18
star
6

ansible-archlinux

Install and configure Archlinux with Ansible
Jinja
13
star
7

docker-recipes

A docker recipes
10
star
8

SDRHunter

Tools for searching the radio of signal
Python
9
star
9

fabrecipes

A recipes for Fabric & Fabtools
Python
8
star
10

pelican-theme-jesuislibre

jesuislibre pelican theme
HTML
6
star
11

dotfiles

My dotfiles
Shell
6
star
12

serialkiller

timeseries database with reduce system
Python
6
star
13

saltstack-config-public

saltstack-config-public
SaltStack
6
star
14

fresco

A radio frequency database
Go
5
star
15

github-summary

Python tool for generate github summary in multiple formats
Python
5
star
16

docker-insomnia

A insomnia docker image
Dockerfile
4
star
17

tetrapol-helper

Helper for using with tetrapol-kit
Python
4
star
18

world-datas-analysis

miscellaneous worlds data and analysis (ex: covid-19)
Python
4
star
19

garchdeps

Tool that show graphical dependencies of the archlinux packages
Python
4
star
20

qgis-starter-kit

A qgis starter kit
QML
3
star
21

python-project-template

A Python project template
Python
3
star
22

CADLibrary

CAD Library
Python
3
star
23

cfwf

Read and write Customized Fixed Width Format flat file library
TypeScript
2
star
24

tea-colors

Preview your terminal colors
Go
2
star
25

nix-apps

Some nix applications packages
Nix
2
star
26

cars-counter-simulator

cars-counter-simulator
Python
2
star
27

dotfiles-older

A shell dotfiles
Python
2
star
28

blog.jesuislibre.org

source du blog jesuislibre.org
CSS
2
star
29

bspwm-doc

Auto generated bspwm documentation
Shell
1
star
30

wooden-scad

OpenSCAD sketch
OpenSCAD
1
star
31

regardons-ailleurs

Site d'analyse de de données #opendata
HTML
1
star
32

domolab.website

domolab website
CSS
1
star
33

go-terminal-games

Console/TTY games writing in Go
Go
1
star
34

prime-number

prime number generator
Python
1
star
35

nix-projects

Nix
1
star