⚙ darkone.system.yubikey
YubiKey strong authentication: fleet-wide PAM U2F + declarative FIDO2 LUKS.
One physical enrollment per (user, key) on the admin host — just yubikey <user> [key] [action] — feeds:
- a public registry
usr/secrets/yubikeys.jsonin the consumer workspace: pamu2fcfg credential, FIDO2 hmac-secret credential id and salt (all useless without the physical key, hence committable); - one sops secret
yubikey/<user>/<key>/luks-secret(the FIDO2-derived LUKS passphrase) plus the sharedluks-passphrase(the passphrase typed at disko install time, needed to authorize new keyslots).
The module then propagates everything declaratively (just apply), without
ever plugging the key on the target hosts:
- login / sudo / greeter: pam_u2f as a password alternative
(
sufficient): touching the key logs in, the sops password remains the automatic fallback. One credential is valid fleet-wide thanks to the fixed origin (pam://<network.domain>). - encrypted hosts: a oneshot service self-enrolls each declared key in
every disko-declared LUKS2 header (keyslot +
systemd-fido2token, the exact formatsystemd-cryptenrollwrites) and prunes revoked ones. The physical key is only ever needed at boot to unlock the disk.
Options
Section titled “Options”- enable
boolYubiKey authentication (default: enabled when usr/secrets/yubikeys.json exists) - origin
strFixed pam_u2f origin/appid: one enrollment is valid fleet-wide - luks.enable
boolFIDO2 unlock of the host LUKS volumes (inert without disko LUKS + enrolled keys)
darkone.system.yubikey = { enable = hasRegistry; origin = "pam://${network.domain}"; luks.enable = true;};Source: modules/system/yubikey.nix 🡕