Skip to content

Narrow a secret's source to the file, and resolve it against the flake - #22

Merged
ocfox merged 3 commits into
masterfrom
secret-source-location
Aug 2, 2026
Merged

Narrow a secret's source to the file, and resolve it against the flake#22
ocfox merged 3 commits into
masterfrom
secret-source-location

Conversation

@ocfox

@ocfox ocfox commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Narrows a secret's file to a store path holding only that file, so a host no longer carries the whole flake source — and every other host's sealed secrets — in its closure. Resolves seal's paths against the flake root rather than the git root, which are the same path only for a flake at the top of its repository.

Also stops a secret owned by another flake from blocking a recipient change. This repository has no copy of it to write, so refusing the run meant being blocked by a file the user cannot fix; seal now re-encrypts what it owns and names the rest when it finishes.

Cache entry names are unchanged, so nothing needs re-sealing.

Fixes #20
Fixes #21

ocfox added 3 commits August 2, 2026 20:25
A secret's `file` was a subpath of the flake source, which carries the
whole source as its context, and the unit that deploys a host references
the profile holding it. Every host therefore carried every other host's
sealed secrets and the rest of the repository. Narrow it to the one file,
as cacheInStore already does for the cache.
The paths seal writes are relative to the flake root, but the wrapper
changed to the git root. The two differ for a flake in a subdirectory of
its repository, where seal then resolved every source secret against the
wrong directory. Being in a git repository is also not the same as being
in this flake's, so the wrapper now checks it landed somewhere with a
flake.nix before writing anything.
A secret whose file comes from another flake has no copy this repository
can write, and refusing the run over it meant a recipient change could be
blocked by a file the user has no way to fix. seal now re-encrypts what it
owns and names the rest when it finishes, so the recipient that cannot
read them is said out loud without being made an error.
@ocfox
ocfox merged commit fdb76df into master Aug 2, 2026
1 check passed
@ocfox
ocfox deleted the secret-source-location branch August 2, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

seal resolves source paths against the git root, not the flake root Every host's closure contains the entire flake source

1 participant