From 25ff6d1e2dac04905cb345261ad085d5d40590f9 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 30 Nov 2026 13:22:23 +0000 Subject: docs: services read views; enstate doesn't configure them The sketch of the NixOS side: services point at the views' paths, which the module names, as they like (LoadCredential=, a configuration file); whether they are restarted when a view changes is up to reactions, since a configuration may restart them itself. --- docs/design.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/design.md b/docs/design.md index ff39c3f..da94eb0 100644 --- a/docs/design.md +++ b/docs/design.md @@ -251,8 +251,7 @@ A sketch of the NixOS side, names not final: enstate.channels.secrets.slots."retiolum.key" = { type = "application/x-openssh-private-key; algorithm=ed25519"; secret = true; - credentialFor = [ "tincr-retiolum" ]; # LoadCredential= follows - reaction.restart = [ "tincr-retiolum" ]; + reactions.restart = [ "tincr-retiolum.service" ]; # unless it restarts itself }; enstate.channels.secrets.slots."retiolum.pub" = { @@ -272,12 +271,19 @@ enstate.views.ssh-known-hosts = { from = [ "fleet/hosts" ]; renderer = ./render-known-hosts; }; + +# The services read views where they are, as they like. +systemd.services.tincr-retiolum.serviceConfig.LoadCredential = + "retiolum.key:${config.enstate.channels.secrets.slots."retiolum.key".path}"; +programs.ssh.extraConfig = "GlobalKnownHostsFile ${config.enstate.views.ssh-known-hosts.path}/known_hosts"; ``` From the declarations the module generates the schema (a file in the -system), the units' credentials, and the receptor's setup. Static -configuration points at the views' stable paths (`GlobalKnownHostsFile -/run/…/ssh-known-hosts`); what is behind them changes. +system) and the receptor's setup. enstate doesn't configure the services +that read views: static configuration points at the views' stable paths, +which the module names (`path`); what is behind them changes. A service +whose `LoadCredential=` reads a view is ordered after the unit that puts +the views in place, without saying so. ### 5.4 Submissions -- cgit v1.3.1