mirror of
https://github.com/RGBCube/agenix
synced 2025-07-29 09:47:44 +00:00
Try to add nix-darwin support to agenix
Merges work by @montchr, @cmhamill, and @rtimush and rebases on main. - fixes https://github.com/ryantm/agenix/issues/60 - fixes https://github.com/ryantm/agenix/issues/120 - closes https://github.com/ryantm/agenix/pull/107
This commit is contained in:
parent
6d3a415637
commit
351e874918
6 changed files with 191 additions and 49 deletions
10
test/install_ssh_host_keys_darwin.nix
Normal file
10
test/install_ssh_host_keys_darwin.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Do not copy this! It is insecure. This is only okay because we are testing.
|
||||
{
|
||||
system.activationScripts.extraUserActivation.text = ''
|
||||
echo "Installing SSH host key"
|
||||
sudo cp ${../example_keys/system1.pub} /etc/ssh/ssh_host_ed25519_key.pub
|
||||
sudo cp ${../example_keys/system1} /etc/ssh/ssh_host_ed25519_key
|
||||
sudo chmod 644 /etc/ssh/ssh_host_ed25519_key.pub
|
||||
sudo chmod 600 /etc/ssh/ssh_host_ed25519_key
|
||||
'';
|
||||
}
|
24
test/integration_darwin.nix
Normal file
24
test/integration_darwin.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
secret = "hello";
|
||||
testScript = pkgs.writeShellApplication {
|
||||
name = "agenix-integration";
|
||||
text = ''
|
||||
grep ${secret} ${config.age.secrets.secret1.path}
|
||||
'';
|
||||
};
|
||||
in {
|
||||
imports = [
|
||||
./install_ssh_host_keys_darwin.nix
|
||||
../modules/age.nix
|
||||
];
|
||||
|
||||
services.nix-daemon.enable = true;
|
||||
|
||||
age.secrets.secret1.file = ../example/secret1.age;
|
||||
|
||||
environment.systemPackages = [testScript];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue