secrets: fix sorting in setup-secrets

Now the bash globbing sort order equals the nix sort order
(order of `processedFiles`)
Previously, `comm` could fail with error `unsorted` on
specific secrets names.
This commit is contained in:
Erik Arvstedt 2022-07-22 11:26:05 +02:00
parent 0d58dadf0a
commit 0ba6c63670
No known key found for this signature in database
GPG Key ID: 33312B944DD97846

View File

@ -173,6 +173,10 @@ in {
RemainAfterExit = true; RemainAfterExit = true;
}; };
script = '' script = ''
# Use the same sort order for globbing and sorting as in Nix attrsets.
# Required for `comm` below.
export LC_COLLATE=C
${optionalString cfg.generateSecrets '' ${optionalString cfg.generateSecrets ''
mkdir -p "${cfg.secretsDir}" mkdir -p "${cfg.secretsDir}"
cd "${cfg.secretsDir}" cd "${cfg.secretsDir}"