agenix/test/integration_darwin.nix

29 lines
570 B
Nix
Raw Normal View History

{
config,
pkgs,
2023-02-11 17:19:01 +03:00
options,
...
}: let
secret = "hello";
testScript = pkgs.writeShellApplication {
name = "agenix-integration";
text = ''
2023-05-04 02:25:54 +03:00
grep "${secret}" "${config.age.secrets.system-secret.path}"
'';
};
in {
imports = [
./install_ssh_host_keys_darwin.nix
../modules/age.nix
];
services.nix-daemon.enable = true;
2023-05-04 02:25:54 +03:00
age = {
identityPaths = options.age.identityPaths.default ++ ["/etc/ssh/this_key_wont_exist"];
secrets.system-secret.file = ../example/secret1.age;
};
environment.systemPackages = [testScript];
}