Skip to content

Built-In Kits Catalog

The std/ sub-flake ships 11 generic, zero-dependency kits. Every kit follows strict user-safety rules: defaults use lib.mkDefault, firewall ports stay closed until you set openFirewall = true, and disk/key kits never hardcode device paths or synthesize placeholder keys.

Kit Roles What it wires
std.kits.sshd server Enables OpenSSH with optional port, custom settings, and opt-in openFirewall
std.kits.borg server, client BorgBackup repos and client jobs wired via peer exports (no forced SSH or surprise paths)
std.kits.postgres server, client PostgreSQL service, peer exports (host, port, databases), persistence, and opt-in openFirewall
std.kits.wireguard peer Valid non-overlapping WireGuard peer mesh from typed per-peer tunnelIp and publicKey records (NAT-safe)
std.kits.monitoring server, agent Prometheus server scraping every agent’s IP:port automatically with opt-in openFirewall
std.kits.remote-builders builder, client Cross-platform Nix distributed builds (nixos builders, os clients for Linux and macOS)
std.kits.disko machine Layout-agnostic Disko wiring importing each host’s own disko file without imposing any disk layout
std.kits.facter machine Attaches per-host nixos-facter JSON report paths when present (optional strict = true)
std.kits.host-files machine Auto-imports existing per-host Nix files (such as hardware-configuration.nix) from a directory
std.kits.dotfiles user Validates declared dots paths at eval time and switches cleanly between store copies and live symlinks
std.kits.homelab hub, node Bundle kit composing std.kits.sshd, std.kits.borg, and std.kits.monitoring via parts

Wiring a homelab and PostgreSQL in 20 lines

Section titled “Wiring a homelab and PostgreSQL in 20 lines”

Here two assemblies wire OpenSSH, Borg backups, Prometheus scraping, and PostgreSQL across nas and box:

modules/homelab.nix
{
yen,
std,
...
}:
{
imports = [
std.modules.all
std.kits.homelab
std.kits.postgres
];
yen.host.nas.addr = "198.51.100.10";
yen.host.box.addr = "198.51.100.20";
# One assembly wires SSH, Borg backups, and Prometheus scraping across both hosts.
yen.assemblies.home = yen.kits.homelab {
hub.at = yen.host.nas;
node.at = yen.host.box;
};
# Second assembly adds PostgreSQL on `nas` with explicit databases and opt-in firewall.
yen.assemblies.app-db = yen.kits.postgres {
server = {
at = yen.host.nas;
settings = {
databases = [ "app" ];
openFirewall = true;
};
};
client.at = yen.host.box;
};
}

Prometheus on nas automatically discovers both 198.51.100.10:9100 and 198.51.100.20:9100, persistence collects /srv/borg, /var/lib/postgresql, and /var/lib/prometheus2, and only explicitly opted-in firewall ports (5432) open:

nix eval .#nixos.nas (Prometheus + Postgres) + .#ports + .#persist
{
persist = {
nas = [ "/var/lib/postgresql" "/srv/borg" "/var/lib/prometheus2" ];
};
ports = {
box = [ ];
nas = [ 5432 ];
};
postgresEnabled = true;
prometheusTargets = [ "198.51.100.20:9100" "198.51.100.10:9100" ];
}

With std.lib.firewallModule, std.lib.persistModule, and std.lib.nixos wired in flake.nix, deploy with sudo nixos-rebuild switch --flake .#nas.

Every role, setting, default, and export of these kits is listed in Std Kits Reference.

Next, see everyday NixOS fleet patterns in Scaling Across Hardware & Form Factors.

ContributeCommunitySponsor