7.6 KiB
7.6 KiB
Session Log
Current Repo State
- The git worktree is dirty. Many files were already modified before or during this session. Do not revert unrelated changes.
- New main host/user additions are already in place:
- hosts:
polaris,zenith,orion - users:
kiri,ergon
- hosts:
zenithis the Lenovo Yoga Slim 7 ProX 14ARH7 laptop.ergonis the work user and is present onpolarisandzenith, notorion.
Naming Decisions
- Host names chosen:
polaris= main machinezenith= laptoporion= VPS
- Work user chosen:
ergon
Den / Architecture Decisions
kiristays onden._.primary-user.ergonis explicit and should not useden._.primary-user.- Do not introduce a local
admin-userbattery yet. Keep repeated patterns explicit until they stabilize. - Prefer host files thin and move reusable behavior into
modules/features/ormodules/profiles/.
Den Helper Mental Model
perHost/perUserare stage gates, not just readability helpers.perUseris not the same asparametric.exactly.- Actual behavior:
perUsergates entry at exact{ host, user }, then evaluates the wrapped aspect under fixed{ host, user }with normalatLeastmatching inside.parametric.exactlyis an inner include matcher based on exact context shape.
- Practical rule used in this repo:
- use
perHostfor host-owned NixOS config that must apply once per host - use
perUserfor host-user-pair HM or NixOS config - avoid
take.*unless doing low-level Den plumbing
- use
Niri / Display Model
lux.niriwas intentionally collapsed back into one conceptual aspect inmodules/features/niri.nix.- It now uses:
den.lib.perHostfor NixOS-side Niri setupden.lib.perUserfor HM-side Niri settings
- Host monitor layout is a host fact, not a user fact.
den.schema.host.displaysexists and is the source of truth for monitor facts.- Current
polarisdisplay layout lives inmodules/infra.nix. programs.niri.settings.outputsis derived fromhost.displays, so bothkiriandergononpolarisget the same output configuration.displaysintentionally has noenabledflag; omission means absent.
SOPS / SSH / GPG Decisions
- Repo-managed GPG was removed from
modules/features/ssh.nix. - If commit signing is added later, prefer SSH signing rather than restoring repo-managed GPG.
- Secret recipient policy currently is:
- one admin age recipient
orionSSH host key recipient
.sops.yamlandmodules/secrets/secrets.yamlwere rekeyed to that policy.
Current SOPS Model
- SOPS is now host-owned conceptually.
- Current host schema fields:
sopsHostSshKeyPathsopsAdminKeyPathsopsAdminKeyUsers
- Current policy:
orionusessops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]for host-level NixOS decryption.- local hosts (
polaris,zenith) use/var/lib/sops-nix/admin-key.txtfor host-level NixOS decryption. - HM SOPS also uses the host-provisioned
/var/lib/sops-nix/admin-key.txt, but only for users listed inhost.sopsAdminKeyUsers.
- Shared reader group:
sops-users
- Current host metadata in
modules/infra.nix:polaris.sopsAdminKeyPath = "/var/lib/sops-nix/admin-key.txt"polaris.sopsAdminKeyUsers = [ "kiri" "ergon" ]zenith.sopsAdminKeyPath = "/var/lib/sops-nix/admin-key.txt"zenith.sopsAdminKeyUsers = [ "kiri" "ergon" ]orion.sopsAdminKeyPath = "/var/lib/sops-nix/admin-key.txt"orion.sopsAdminKeyUsers = [ "kiri" ]orion.sopsHostSshKeyPath = "/etc/ssh/ssh_host_ed25519_key"
- Important operational caveat:
- the admin key file is expected to be provisioned out-of-band on hosts
- config creates
/var/lib/sops-nixvia tmpfiles and adds listed users tosops-users, but does not create the private key itself
SSH Recovery Policy
orionis treated as the remote recovery-critical host.modules/features/services/openssh.nixnow owns both:- OpenSSH base config
- user
authorizedKeys
- Recovery assertions now enforce for
requiresSshRecovery = true:- OpenSSH enabled
- password auth disabled
- root login disabled
sshRecoveryUsersnon-empty- every recovery user exists
- every recovery user has plain
authorizedSshKeys sopsHostSshKeyPathnon-null- SSH exposed through firewall
AllowUsers = lib.attrNames host.usersis still the intended model.
Recent Validation Results
- Successfully built after the Niri / SOPS / SSH refactors:
nix build .#nixosConfigurations.polaris.config.system.build.toplevel --show-tracenix build .#nixosConfigurations.orion.config.system.build.toplevel --show-tracenix build .#nixosConfigurations.zenith.config.system.build.toplevel --show-trace
- Verified by evaluation:
polarisNiri outputs forkiriandergonmatch- local hosts resolve
config.sops.age.keyFile = "/var/lib/sops-nix/admin-key.txt" orionresolvesconfig.sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]- HM SOPS for allowed users resolves
"/var/lib/sops-nix/admin-key.txt" ergon@polarishas["sops-users", "wheel", "networkmanager"]- tmpfiles includes
d /var/lib/sops-nix 0750 root sops-users -
Remaining Warnings / Caveats
- Builds still emit pre-existing Home Manager default-change warnings:
gtk.gtk4.themexdg.userDirs.setSessionVariablesprograms.git.signing.format
- These warnings were not addressed in this session.
- There is no deployment wrapper or automated bootstrap tooling yet.
nixos-anywhere --copy-host-keysremains the intendedorioninstall approach when preserving the SSH host key for first-boot SOPS decryption.
Architecture Contract
- Added
ARCHITECTURE.mdas the single durable reference for the repo's intended 1.0 structure. - The contract is grounded in the current codebase:
schemaandinfraown factsusersown cross-host user baselinesfeaturesown reusable behaviorprofilesandenvironmentsown bundlinghostsstay thin and compose the final machine shape
- Kept the existing Den helper convention explicit:
perHostandperUserare stage gatesparametric.exactlyis only for exact inner matching- avoid new local batteries until the pattern is stable
- No repo redesign was done; this was documentation only.
- Validation:
- doc-only change
- no
nix buildrun in this session
- Small open question for later:
- whether
ARCHITECTURE.mdshould stay standalone or also be linked fromAGENTS.md/ future README if a contributor-facing index is added
- whether
Architecture Simplification
- Collapsed
environmentsintoprofiles. - Current rule is now simpler:
featuresare the smallest reusable behavior unitsprofilesare all named bundles larger than a single featurehostsstill own final composition and explicit host-specific exceptions
modules/environments.nixwas removed.graphicalanddevelopmentnow live underlux.profiles._.- Kept the repeated
provides.kiri/provides.ergonhost wiring explicit for now. The duplication is intentional until a shared host-composition pattern is clearly stable enough to justify extraction. - Validation:
nix build .#nixosConfigurations.polaris.config.system.build.toplevel --show-tracenix build .#nixosConfigurations.orion.config.system.build.toplevel --show-tracenix build .#nixosConfigurations.zenith.config.system.build.toplevel --show-trace
MANUAL INTERVENTION NOTE BY HUMAN USER, NOT AI AGENT
Removed ARCHITECTURE.md. Pinning down the architecture this explicitly feels too rigid and unnecessary.
Perhaps a more generally applicable Design Philsophy would be more helpful and allow for more flexibility.