inventory tests: add vars support

- Add support for leading vars
- Extend test to test for vars support
- Improve update-vars.py to take test name as argument
This commit is contained in:
DavHau
2025-04-08 20:23:57 +07:00
parent ffac38e299
commit 26e97c066c
3 changed files with 88 additions and 12 deletions

View File

@@ -47,6 +47,20 @@ in
documentation.enable = lib.mkDefault false;
nix.settings.min-free = 0;
system.stateVersion = config.system.nixos.release;
boot.initrd.systemd.enable = false;
# setup for sops
sops.age.keyFile = "/run/age-key.txt";
system.activationScripts =
{
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 != { }) {
setupSecretsForUsers.deps = [ "age-key" ];
};
}
);