14 KiB
roles/thin-client — AZ-NIX-CLIENTS Thin Client Fleet
NixOS role for the AZ-TC-NN fleet. Replaces a Windows 10 workstation
with a locked-down NixOS + KDE Plasma client that authenticates against
Active Directory and provides pre-configured RDP, browser, and Office-Web
access.
This document describes the provisioning workflow for a new Fleet Host.
Decision summary
All 20 design decisions from the grilling session are captured in the
top-level default.nix comments and the individual submodule headers.
Quick reference:
| Area | Decision |
|---|---|
| Hardware | Dell OptiPlex Micro (3020/3040/5040/7040) + generic-x86_64-uefi fallback |
| Deployment | Stock Linux ISO + nixos-anywhere |
| Disk | BTRFS (@root, @home, @nix, @persist, @snapshots), zstd |
| AD | Realm AZ-GROUP / DNS az-group.local, pre-created computer accounts + keytab via agenix |
| Shell | bash for domain users |
| Session | KDE Plasma 6, Wayland, SDDM, no autologin |
| Sudo | %domain admins with password; local sascha.koenig + jannik.mueller as break-glass |
| WiFi | 802.1X EAP-TLS per-machine, NetworkManager + wpa_supplicant (not iwd) |
| SMB | pam_mount, Kerberos, DFS namespace, lax offline |
| RDP | System-wide Remmina, Kerberos SSO, fullscreen multi-monitor, audio local only |
| Office | 5 .desktop shortcuts via chromium --app=URL; Outlook + Teams autostart |
| Chromium | ManagedBookmarks, sync disabled, uBlock Origin + Bitwarden, no local passwords |
| RustDesk | Client + daemon, self-hosted server, pre-shared key, Wayland portal pre-authorized |
| OBS | Pre-configured "AZ-Default" profile, output to ~/Videos/OBS/ |
| NetBird | Per-host setup key, corp DNS + NetBird DNS parallel, accept-routes |
| Printers | Single Pull-Print queue, direct IPPS, Avahi off |
| Branding | Light: corporate wallpaper + SDDM logo + property footer, no banner |
| Updates | system.autoUpgrade daily at 03:00, reboot window 03:00-05:00 |
| Monitoring | node_exporter → Pushgateway, Alloy → Loki (journal), Snipe-IT asset check-in (daily 03:30) |
| Rollout | Pilot: 3 hosts, 2 weeks; then 5 → 10 → rest |
AZ-TC-01 pilot status
Confirmed infrastructure values for the pilot (hosts/AZ-TC-01/default.nix):
- AD DNS domain:
az-group.local - Kerberos realm:
AZ-GROUP.LOCAL - DCs:
azdc01.az-group.local(192.168.152.253) andadpdc01.az-group.local(192.168.152.254) - Computer objects currently use the default
CN=Computerscontainer. - Pilot WiFi uses WPA-Personal SSID
Pluto;SaturnEAP-TLS is deferred.
Provisioning workflow for a new Fleet Host
Copy hosts/AZ-TC-01/default.nix to hosts/AZ-TC-NN/default.nix and
update the hostname, site, hardware class and target disk. Thin Client
host directories are discovered automatically; no manual flake entry is
required.
For a lab installation use site = "staging" and explicitly enable only
integrations whose infrastructure values and secrets are available. The
production site enables AD, WiFi, NetBird, RustDesk and monitoring by
default.
Step 0 — Create the host age identity
Each host uses a dedicated age identity rather than its SSH host key. This avoids a first-boot dependency on an SSH key that does not exist yet.
mkdir -p .secrets/identities
age-keygen -o .secrets/identities/AZ-TC-01.age
age-keygen -y .secrets/identities/AZ-TC-01.age
Add the printed age1... recipient to secrets.nix and use it as the host
recipient for all AZ-TC-01 secrets. The private identity is ignored by Git
and is copied to /var/lib/agenix/identity.age only during provisioning.
Step 1 — Pre-create the AD computer account + keytab
Run from a host that can reach the AD DC (e.g. AZ-LT-NIX). Requires
adcli (available on the admin workstation via nix-shell -p adcli if
not installed).
For AZ-TC-01, no ThinClients OU exists yet, so the computer account is
created in the default CN=Computers container (omit --domain-ou).
# Check AD discovery and clock before joining
nix shell nixpkgs#adcli nixpkgs#krb5 nixpkgs#bind -c bash
dig +short SRV _kerberos._tcp.az-group.local @192.168.152.253
dig +short SRV _ldap._tcp.dc._msdcs.az-group.local @192.168.152.253
timedatectl status
# Obtain an administrator Kerberos ticket
kinit administrator@AZ-GROUP.LOCAL
klist
# Create the computer account and binary keytab in one step
umask 077
adcli join \
--domain=az-group.local \
--domain-controller=azdc01.az-group.local \
--host-fqdn=AZ-TC-01.az-group.local \
--computer-name=AZ-TC-01 \
--os-name=NixOS \
--os-version=26.05 \
--login-ccache="${KRB5CCNAME:-/tmp/krb5cc_$(id -u)}" \
--host-keytab=/tmp/AZ-TC-01.keytab \
--verbose
# Validate the binary keytab before encryption
klist -k -e /tmp/AZ-TC-01.keytab
# Expected principals include:
# AZ-TC-01$@AZ-GROUP.LOCAL
# host/AZ-TC-01.az-group.local@AZ-GROUP.LOCAL
Never paste a binary keytab into an editor. Encrypt it directly and verify the round trip before committing:
agenix -e secrets/AZ-TC-01-krb5-keytab.age < /tmp/AZ-TC-01.keytab
verified_keytab="$(mktemp)"
chmod 0600 "$verified_keytab"
trap 'rm -f "$verified_keytab" /tmp/AZ-TC-01.keytab' EXIT
nix shell nixpkgs#age -c age --decrypt \
-i .secrets/identities/AZ-TC-01.age \
secrets/AZ-TC-01-krb5-keytab.age \
> "$verified_keytab"
nix shell nixpkgs#krb5 -c klist -k -e "$verified_keytab"
rm -f "$verified_keytab" /tmp/AZ-TC-01.keytab
trap - EXIT
If the installed adcli only exposes the short option for the keytab
path, replace --host-keytab=/tmp/AZ-TC-01.keytab with
-K /tmp/AZ-TC-01.keytab after confirming via adcli join --help.
Step 2 — Provision NetBird setup key
In the NetBird UI (https://netbird.az-group.local):
- Go to Setup Keys → Generate new key.
- Name:
AZ-TC-01, Type: one-time (or reusable for fleet), Expires: 90d. - Copy the key value.
agenix -e secrets/AZ-TC-01-netbird-setupkey.age→ paste the key.
Step 3 — Provision WiFi client certificate (Saturn, deferred for AZ-TC-01)
In AD CS (https://certsrv.az-group.local/certsrv):
-
Request a Certificate → Advanced certificate request.
-
Template: Workstation Authentication (or your corp 802.1X template).
-
Subject:
CN=AZ-TC-01$. -
Export the cert + private key as PKCS#12 (
.pfx), with exportable key. -
Convert to combined PEM (cert + key in one file):
openssl pkcs12 -in AZ-TC-01.pfx -out AZ-TC-01.pem -nodes -
agenix -e secrets/AZ-TC-01-wifi-client-cert.age→ paste the PEM.
Step 3b — Bootstrap on the temporary Pluto PSK network (AZ-TC-01 pilot)
While the Saturn EAP-TLS certificate is deferred, AZ-TC-01 connects to
the temporary WPA-Personal network Pluto instead
(az.tc.wifi.mode = "psk", see roles/thin-client/network/wifi.nix).
Enter the password locally, without putting it in shell history or chat:
read -rsp 'Pluto WiFi password: ' WIFI_PSK
printf '\n'
printf '%s' "$WIFI_PSK" | nix develop --command agenix -e secrets/AZ-TC-01-wifi-psk.age
unset WIFI_PSK
Do not use echo, because it may add an unintended trailing newline to
the PSK. Verify the host identity can decrypt the secret without printing
it:
nix shell nixpkgs#age -c age --decrypt \
-i .secrets/identities/AZ-TC-01.age \
secrets/AZ-TC-01-wifi-psk.age \
| test -s /dev/stdin
The password must never be committed in plaintext or sent through chat —
only the encrypted .age file is safe to commit.
Step 4 — Provision RustDesk credentials
# Generate a strong permanent password per host
PW=$(openssl rand -base64 24)
echo -n "$PW" > /tmp/AZ-TC-01-rustdesk-pw.txt
agenix -e secrets/AZ-TC-01-rustdesk-password.age
# Paste /tmp/AZ-TC-01-rustdesk-pw.txt contents.
rm /tmp/AZ-TC-01-rustdesk-pw.txt
The shared rustdesk-psk.age is one-time setup, reused for all hosts.
Step 5 — Provision the host
Boot the OptiPlex from a stock Linux ISO (any modern NixOS installer ISO or Ubuntu live ISO works). Set a temporary root password on the installer and ensure its SSH service is running:
passwd
Then run the deployment from the admin workstation:
# Non-destructive local and remote preflight
nix run .#deploy -- --check AZ-TC-01 root@<target-ip>
# Install after showing the target hardware and confirming disk erasure
nix run .#deploy -- AZ-TC-01 root@<target-ip>
The wrapper accepts the installer's new host key in an isolated temporary
file and leaves ~/.ssh/known_hosts unchanged. SSH may ask for the temporary
root password more than once during preflight and installation; no SSH key
needs to be provisioned on the installer.
The host will:
- Partition the disk via disko (BTRFS layout).
- Install NixOS from the flake.
- Reboot into the new system.
- On first boot: agenix decrypts secrets, sssd starts with keytab, NetBird enrolls via setup key, WiFi connects via EAP-TLS.
The wrapper refuses to install if the selected host does not evaluate, the configured target disk does not exist, a required secret is empty, or the host age identity cannot decrypt an enabled feature's secret.
Post-boot AD and WiFi checks
After first boot, run this operator checklist to confirm the pilot came up healthy:
nmcli --fields NAME,TYPE,DEVICE connection show --active
resolvectl query azdc01.az-group.local adpdc01.az-group.local
systemctl --no-pager --full status sssd
sssctl domain-status az-group.local
getent passwd '<known-ad-user>'
id '<known-ad-user>'
Replace <known-ad-user> with a real non-administrator test account.
Test offline login (disconnect network, log in from SSSD's credential
cache) only after one successful online login with that account.
Option reference
All tunable parameters live under az.tc.*:
| Option | Default | Description |
|---|---|---|
az.tc.enable |
false |
Activate the thin-client role |
az.tc.hardwareClass |
generic-x86_64-uefi |
One of dell-optiplex-micro or generic-x86_64-uefi |
az.tc.site |
default |
Site identifier (informational) |
az.tc.ad.ou |
OU=ThinClients,DC=az-group,DC=local |
AD Organizational Unit for computer objects |
az.tc.wifi.mode |
eap-tls |
WiFi authentication mode: psk (temporary WPA-Personal) or eap-tls |
az.tc.wifi.ssid |
AZ-CORP |
Corp WiFi SSID |
az.tc.wifi.caCert |
./assets/corp-wifi-ca.pem |
Corp CA cert (NOT secret) |
az.tc.netbird.managementUrl |
https://netbird.az-group.local:443 |
NetBird server URL |
az.tc.smb.dfsNamespace |
\\\\az-group.local\\dfs |
DFS namespace root |
az.tc.smb.userShare |
users/%u |
Per-user share path |
az.tc.smb.commonShares |
[public software] |
Common share names |
az.tc.smb.mountRoot |
/mnt/az-dfs |
Local mount root |
az.tc.printing.pullPrintEndpoint |
ipps://pull-print.az-group.local:443/ipp/print |
Pull-Print IPPS URI |
az.tc.printing.queueName |
Pull-Print |
Local CUPS queue name |
az.tc.rdp.servers |
[{name="TS Berlin"; fqdn="ts-berlin.az-group.local";}] |
TS endpoints |
az.tc.chromium.homepage |
https://www.office.com |
Browser homepage |
az.tc.chromium.bookmarks |
[Outlook, Teams, SharePoint, Office] |
Managed bookmarks |
az.tc.chromium.bitwardenServerUrl |
https://vault.bitwarden.com |
Bitwarden URL |
az.tc.rustdesk.serverHost |
rustdesk.az-group.local |
RustDesk server host |
az.tc.branding.hotline |
+49 30 1234567 |
IT hotline for footer |
az.tc.branding.wallpaper |
./assets/wallpaper.svg |
Wallpaper path |
az.tc.branding.logo |
./assets/logo.svg |
Logo path |
az.tc.branding.company |
AzIntec GmbH |
Company name |
az.tc.monitoring.prometheusPushGateway |
pushgateway.az-group.local:9091 |
Pushgateway URL |
az.tc.monitoring.lokiUrl |
http://loki.az-group.local:3100 |
Loki URL |
az.tc.monitoring.snipeItUrl |
https://snipeit.az-group.local |
Snipe-IT base URL |
az.tc.monitoring.assetTool |
snipe-it |
Asset tool integration |
az.tc.deployment.diskDevice |
/dev/sda |
Disko target disk |
az.tc.deployment.swapSizeGB |
4 |
Swap size in GB |
Open items before pilot deploy
These placeholders need real values before pilot deploy. They're flagged
with # TODO: in the respective modules.
- Real corp WiFi SSID
- Real CA root cert (replace
corp-wifi-ca.pem) - Real DFS namespace path
- Real common share names
- Real Terminal Server endpoints
- Real Chromium bookmarks (Intranet, Helpdesk, ERP, HR)
- Real Bitwarden server URL (if self-hosted)
- Real RustDesk server hostname
- Real Pull-Print IPPS endpoint
- Real NetBird management URL
- Real Prometheus Pushgateway URL
- Real Loki URL
- Real IT-Hotline phone number
- Real corporate wallpaper asset (replace placeholder SVG)
- Real corporate logo asset (replace placeholder SVG)
- Real AD Computer OU DN (AZ-TC-01 currently uses the default
CN=Computerscontainer) - Real
SaturnEAP-TLS certificate for AZ-TC-01 (currently on temporary WPA-PersonalPluto)
Build validation
To validate the config without deploying:
# Eval-check all hosts
nix flake check
# Build a pilot host closure (full closure, takes ~20 min uncached)
nix build --no-link .#nixosConfigurations.AZ-TC-01.config.system.build.toplevel
# Try a VM boot
nix run .#nixosConfigurations.AZ-TC-01.config.system.build.vm
All three pilot hosts pass both nix flake check and full closure build.
Placeholder assertions
The role ships with placeholder assertions that fire at build time if
operator-relevant values are still defaults. To silence for lab/staging
hosts, set az.tc.site = "staging" (see hosts/AZ-TC-01/default.nix).
Currently asserted:
az.tc.wifi.ssid != "AZ-CORP"— real Corp SSID must be setaz.tc.branding.hotline != "+49 30 1234567"— real hotline must be setaz.tc.branding.company != "AzIntec GmbH"— real company name must be set
Add more assertions as customer-specific values firm up.