Move mobile device SSH keys into a separate external systems list #45

Open
opened 2026-11-07 19:50:54 +00:00 by martin · 2 comments
Owner

Summary

The mobile devices localhost-y4maoyqm and localhost-4izgka9k live in systems.nix alongside buildable hosts. They are SSH clients, not NixOS hosts, but every consumer of systems treats them as one. Keep the devices and their SSH access, and move their public keys into a separate list of external systems that is consumed only where device access is needed.

Context

systems.nix defines both devices with kind = "mobile"; the Pixel entry carries a # TODO update key note. The same attrset drives four unrelated concerns:

  • flake.nix builds nixosConfigurations from every entry, producing localhost-y4maoyqm and localhost-4izgka9k configurations whose hosts/localhost-* directories do not exist. Any evaluation that forces them fails.
  • shared/base/modules/security/ssh.nix adds the device keys to programs.ssh.knownHosts, as if they were host keys for hostnames that are not real hosts.
  • shared/base/modules/security/ssh.nix adds the device keys to openssh.authorizedKeys.keys; this is the SSH access the devices depend on.
  • shared/base/home-manager/development/git.nix adds the device keys to git allowed_signers, so a device key can produce a commit that verifies as git@martials.no.

Nothing filters on kind == "mobile"; the only kind consumer is the Zed server list, which filters for kind == "server". Deleting the entries outright would drop device SSH access, which is why the keys move instead.

Scope

  • Add a dedicated external systems list, for example external-systems.nix next to systems.nix, keyed by device name and holding each device's public SSH key.
  • Pass the list to modules alongside systems, and source openssh.authorizedKeys.keys from host keys plus external system keys.
  • Remove the mobile entries from systems.nix so nixosConfigurations and knownHosts contain only real hosts, and drop the now-unused mobile kind.
  • Keep the Pixel # TODO update key note with the key and confirm whether it is current.
  • Decide whether external systems remain git allowed_signers (current behaviour) or whether only host keys may sign commits.

Out of scope

  • Adding devices or rotating keys beyond confirming the Pixel entry.
  • Changing git signing principals or Forgejo instance signing, which is tracked in #64.

Acceptance criteria

  • External system keys live in a dedicated list separate from systems.
  • Every host still authorizes the device keys through openssh.authorizedKeys.keys.
  • systems contains only buildable hosts, and nixosConfigurations no longer includes localhost-* entries.
  • programs.ssh.knownHosts contains host keys only.
  • The Pixel key is confirmed current or replaced, resolving the TODO.
  • The decision on whether external systems may sign commits is recorded.
  • just fmt and a build of each host succeed without activation.

Dependencies

  • None. Related to #64 for git signing principals.
## Summary The mobile devices `localhost-y4maoyqm` and `localhost-4izgka9k` live in `systems.nix` alongside buildable hosts. They are SSH clients, not NixOS hosts, but every consumer of `systems` treats them as one. Keep the devices and their SSH access, and move their public keys into a separate list of external systems that is consumed only where device access is needed. ## Context `systems.nix` defines both devices with `kind = "mobile"`; the Pixel entry carries a `# TODO update key` note. The same attrset drives four unrelated concerns: - `flake.nix` builds `nixosConfigurations` from every entry, producing `localhost-y4maoyqm` and `localhost-4izgka9k` configurations whose `hosts/localhost-*` directories do not exist. Any evaluation that forces them fails. - `shared/base/modules/security/ssh.nix` adds the device keys to `programs.ssh.knownHosts`, as if they were host keys for hostnames that are not real hosts. - `shared/base/modules/security/ssh.nix` adds the device keys to `openssh.authorizedKeys.keys`; this is the SSH access the devices depend on. - `shared/base/home-manager/development/git.nix` adds the device keys to git `allowed_signers`, so a device key can produce a commit that verifies as `git@martials.no`. Nothing filters on `kind == "mobile"`; the only `kind` consumer is the Zed server list, which filters for `kind == "server"`. Deleting the entries outright would drop device SSH access, which is why the keys move instead. ## Scope - Add a dedicated external systems list, for example `external-systems.nix` next to `systems.nix`, keyed by device name and holding each device's public SSH key. - Pass the list to modules alongside `systems`, and source `openssh.authorizedKeys.keys` from host keys plus external system keys. - Remove the mobile entries from `systems.nix` so `nixosConfigurations` and `knownHosts` contain only real hosts, and drop the now-unused `mobile` kind. - Keep the Pixel `# TODO update key` note with the key and confirm whether it is current. - Decide whether external systems remain git `allowed_signers` (current behaviour) or whether only host keys may sign commits. ## Out of scope - Adding devices or rotating keys beyond confirming the Pixel entry. - Changing git signing principals or Forgejo instance signing, which is tracked in #64. ## Acceptance criteria - [ ] External system keys live in a dedicated list separate from `systems`. - [ ] Every host still authorizes the device keys through `openssh.authorizedKeys.keys`. - [ ] `systems` contains only buildable hosts, and `nixosConfigurations` no longer includes `localhost-*` entries. - [ ] `programs.ssh.knownHosts` contains host keys only. - [ ] The Pixel key is confirmed current or replaced, resolving the TODO. - [ ] The decision on whether external systems may sign commits is recorded. - [ ] `just fmt` and a build of each host succeed without activation. ## Dependencies - None. Related to #64 for git signing principals.
Author
Owner

These are used for ssh, and a removal would case them to not be able to sign in

These are used for ssh, and a removal would case them to not be able to sign in
martin changed title from Remove mobile devices from systems definitions to Move mobile device SSH keys into a separate external systems list 2026-11-21 09:32:23 +00:00
Author
Owner

Decisions

  • Keep the mobile devices and their SSH access. Their public keys move out of systems.nix into a separate external systems list instead of being deleted.
  • Mobile devices are SSH clients, not hosts, so they should not appear in nixosConfigurations or programs.ssh.knownHosts.

Open questions

  • Pixel 11 key: the entry carries # TODO update key; confirm the key is current before moving it, since a stale key grants SSH access to whoever holds it.
  • Git signing: external system keys are currently allowed_signers and can sign as git@martials.no. Keep that behaviour or restrict signers to host keys?

Scope and acceptance criteria updated accordingly.

## Decisions - Keep the mobile devices and their SSH access. Their public keys move out of `systems.nix` into a separate external systems list instead of being deleted. - Mobile devices are SSH clients, not hosts, so they should not appear in `nixosConfigurations` or `programs.ssh.knownHosts`. ## Open questions - Pixel 11 key: the entry carries `# TODO update key`; confirm the key is current before moving it, since a stale key grants SSH access to whoever holds it. - Git signing: external system keys are currently `allowed_signers` and can sign as `git@martials.no`. Keep that behaviour or restrict signers to host keys? Scope and acceptance criteria updated accordingly.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Personal/nixos-configuration#45
No description provided.