Checks: add nixosIntegration test example to hello-service

This commit is contained in:
Johannes Kirschbauer
2025-04-21 18:39:09 +02:00
committed by Mic92
parent 4715c64425
commit 0756baa5dc
6 changed files with 82 additions and 3 deletions

View File

@@ -4,13 +4,17 @@
# configures a static age-key to skip the age-key generation
sops.age.keyFile = "/run/age-key.txt";
system.activationScripts =
let
# https://github.com/Mic92/sops-nix/blob/61154300d945f0b147b30d24ddcafa159148026a/modules/sops/default.nix#L27
hasRegularSecrets = lib.filterAttrs (_: v: v.neededForUsers) config.sops.secrets != { };
in
{
setupSecrets.deps = [ "age-key" ];
age-key.text = ''
echo AGE-SECRET-KEY-1PL0M9CWRCG3PZ9DXRTTLMCVD57U6JDFE8K7DNVQ35F4JENZ6G3MQ0RQLRV > /run/age-key.txt
'';
}
// lib.optionalAttrs (lib.filterAttrs (_: v: v.neededForUsers) config.sops.secrets != { }) {
// lib.optionalAttrs (hasRegularSecrets) {
setupSecrets.deps = [ "age-key" ];
setupSecretsForUsers.deps = [ "age-key" ];
};
}