NixOps definition of my homelab!
I'm learning NixOps so the code quality (code reuse, layout strategy, etc.) is mediocre.
deployments
- Includes all NixOPS deployments definitions.host
- Definition of anhost
within the network. Ahost
can have multiplesroles
. Ahost
still has configurable variables that must be configured within a deployment.nix
- NixOS package source managed using Nivroles
- Contains definitions of specific roles ahost
can have
Usage of the provided shell.nix
using either nix-shell
or lorri
is recommended.
The NIX_PATH environment variable is modified to add a custom root path for use with imports.
TODO
My roadmap to making a good use out of NixOps
-
Define a directory structure
- Per-host?
- Per-functionality (akin to a role in Ansible)?
-
Reuse code as much as possible
-
Define a new host easily
-
Keep track of the host inventory
NixOps has the
nixops export
command. NixOps preserves the deployment state in$HOME/.nixops/deployments.nixops
by default. -
Document the infrastructure
- Using a custom structure that exposes a
comment = types.str;
alongside preprocessing to remove the comments - Dynamically generate the documentation
- ???
- Using a custom structure that exposes a
- Debug systemd-networkd links/networks configuration:
SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/${DEVICE}
- The nixops defaults module
- Writing NixOS Modules
- Discovering Nix: Provisioning a static webserver with NixOps
- NixOps deployment configuration for IOHK devops
- krops vs. NixOps
- Secure, Declarative Key Management with NixOps, Pass, and nix-plugins
- How to set persistent NIC device name via udev
- Network Interface Names
- NixOps - Managing Keys
- ArchLinux: systemd-networkd