Skip to content

Latest commit

 

History

History
30 lines (28 loc) · 1.17 KB

README.md

File metadata and controls

30 lines (28 loc) · 1.17 KB

Homenix

NixOS configuration for my homelab.

First time setup

After flashing the base NixOS image to the nodes, some setup is required for this config to work:

  1. Change the sshUser to nixos in flake.nix. This is only required for the initial deploy, after that we'll use the root user with an ssh key.
  2. Configure sops-nix with the node's public age keys.
# Get public age key on the node
sudo nix-shell -p ssh-to-age --run 'cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age'
# Update keys in `.sops.yaml`
# Re-encrypt files
nix-shell -p sops --run "sops updatekeys secrets/secrets.json"
  1. Make sure to include your public ssh keys in ./modules/common.nix.
  2. For k3s to work properly, you first need to deploy node1, retrieve the server token with cat /var/lib/rancher/k3s/server/token and edit it in the secret file to make sure k3s agents can connect to the server.

Deploy

Deploy the config:

nix run github:serokell/deploy-rs .

If you only want to deploy a certain node:

nix run github:serokell/deploy-rs .#node1