Nix system configuration for Deuxfleurs clusters
cluster | ||
doc | ||
experimental | ||
nix | ||
secretmgr | ||
.gitignore | ||
deploy_nixos | ||
deploy_passwords | ||
deploy_pki | ||
deploy_wg | ||
gen_pki | ||
passwd | ||
README.md | ||
README.more.md | ||
restic-summary | ||
ssh_known_hosts | ||
sshtool | ||
tlsproxy | ||
upgrade_nixos |
Deuxfleurs on NixOS!
This repository contains code to run Deuxfleur's infrastructure on NixOS.
It sets up the following:
- A Wireguard mesh between all nodes
- Consul, with TLS
- Nomad, with TLS
How to welcome a new administrator
See: https://guide.deuxfleurs.fr/operations/acces/pass/
Basically:
- The new administrator generates a GPG key and publishes it on Gitea
- All existing administrators pull their key and sign it
- An existing administrator reencrypt the keystore with this new key and push it
- The new administrator clone the repo and check that they can decrypt the secrets
- Finally, the new administrator must choose a password to operate over SSH with
./passwd prod rick
whererick
is the target username
How to create files for a new zone
The documentation is written for the production cluster, the same apply for other clusters.
Basically:
- Create your
site
file incluster/prod/site/
folder - Create your
node
files incluster/prod/node/
folder - Add your wireguard configuration to
cluster/prod/cluster.nix
- You will have to edit your NAT config manually
- To get your node's wg public key, you must run
./deploy_prod prod <node>
, see the next section for more information
How to deploy a Nix configuration on a fresh node
We suppose that the node name is datura
.
Start by doing the deployment one node at a time, you will have plenty of time
in your operator's life to break everything through automation.
Run:
./deploy_wg prod datura
- to generate wireguard's keys./deploy_nixos prod datura
- to deploy the nix configuration files- need to be redeployed on all nodes as the new wireguard conf is needed everywhere
./deploy_password prod datura
- to deploy user's passwords- need to be redeployed on all nodes to setup the password on all nodes
./deploy_pki prod datura
- to deploy Nomad's and Consul's PKI
How to operate a node
To be written
More
Please read README.more.md for more detailed information