All Module options are documeted at: https://pinpox.github.io/nixos/
This repository includes all configurations for my NixOS machines. Feel free to use parts of it as you please, but keep it mind it is intended mostly for personal use. I've written posts about certain aspects of this setup on my personal blog.
The structure of this repository is meant to allow easy manual deployment.
Individual hosts are defined in /machines/<hostname>
and will import re-usable
parts of the configuration as needed.
Deployment and management is done with clan. Secrets are stored in pass.
TL;DR To use a host configuration on a fresh install, make sure that:
- The hostname is set correctly (
hostname <machine name>
) - You are connected to the internet and have access rights to the repository
- Pass has the necessary secrets for the machine
- The machine's config is up-to-date
Then backup the generated hardware-configuration.nix
file:
# Overwrite hardware-configuration.nix file with the generated one
cp /etc/nixos/hardware-configuration.nix \
./machines/$(hostname)/hardware-configuration.nix
# Commit and push the new file
git commit -am"Add hardware-configuration for $(hostname)" && git push
TODO: update
It is also possible to build on the system itself when logged in, e.g. to get additional debug information.
cd /var/src/machine-config
sudo nixos-rebuild --flake ".#kartoffel" switch
Configuration | Type | Location | VPN IP | Description |
---|---|---|---|---|
kartoffel | Desktop | local | 192.168.7.3 |
Desktop |
limette | Desktop | local | 192.168.7.2 |
Notebook |
birne | Server | local | 192.168.7.4 |
Local NAS |
porree | Server | netcup.de | 192.168.7.1 |
Server for pablo.tools |
kfbox | Server | netcup.de | 192.168.7.5 |
Server for 0cx.de |
The services running on each host are documented in the host-specific
README.md
files.
Deployment is done via clan CLI provided via the flake's
default nix shell. I use direnv to automatically start it
when entering the repository's directory. Run direnv allow
on the first time,
after that, deployment can be done via:
clan machines update <hostname>
While contributions don't make much sense for a personal configuration repository, I'm always happy to get hints, tips and constructive criticism. If you find something that could be done in a better way, please let me know!