Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generator with dependencies without generator #67

Merged
merged 1 commit into from
Jan 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions apps/generate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,11 @@ let
file = sourceFile;
name = secretName;
decrypt = ageMasterDecrypt;
deps = flip map secret.generator.dependencies (
dep:
assert assertMsg (
dep.generator != null
) "The given dependency with rekeyFile=${dep.rekeyFile} is a secret without a generator.";
{
host = findHost dep;
name = dep.id;
file = relativeToFlake dep.rekeyFile;
}
);
deps = flip map secret.generator.dependencies (dep: {
host = findHost dep;
name = dep.id;
file = relativeToFlake dep.rekeyFile;
});
};
in
# Filter secrets that don't need to be generated
Expand Down Expand Up @@ -159,7 +153,9 @@ let
stages = flip mapAttrs secretsWithContext (
_: contextSecret:
stringsWithDeps.fullDepEntry (secretGenerationCommand contextSecret) (
map (x: relativeToFlake x.rekeyFile) contextSecret.secret.generator.dependencies
map (x: relativeToFlake x.rekeyFile) (
filter (dep: dep.generator != null) contextSecret.secret.generator.dependencies
)
)
);
in
Expand Down
Loading