feat: add support for specialisations - #121
Open
Lukas-C wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Having had some time to think about this, I still don't like the issue with name collisions potentially silently swallowing configurations. While this may be only be a minor issue in practice, I think a better way to approach this may be to change the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #120.
Changes
Adds initial support for specialisations by treating them as separate configurations during generation and rekeying operations.
Both NixOS and Home Manager specialisations are supported.
Users of existing configurations should see no changes in usage, it should all just work™.
Notes/Limitations
localStorageDir.Otherwise the generated secrets will be immediately garbage collected as orphaned secrets.
For the same reason, there is no deduplication of secrets between the different specialisations.
However, if e.g. a configuration with the name
foo:barexists and a separate configuration with the namefooand a specialisationbarexists as well, one will likely overwrite the other and rekeying will not work as expected, if at all.Testing
A minimal flake that provides a usage example and some basic test cases can be found here.
My personal config that uses the derivation storage mode also appears to work with the implementation.
Todo
localStorageDirs. A note about the name collision issue above may also be not a bad idea.