agenix/test/install_ssh_host_keys.nix

16 lines
473 B
Nix
Raw Normal View History

2021-05-10 00:22:48 +03:00
# Do not copy this! It is insecure. This is only okay because we are testing.
{
system.activationScripts.agenixInstall.deps = ["installSSHHostKeys"];
2021-05-10 00:22:48 +03:00
system.activationScripts.installSSHHostKeys.text = ''
mkdir -p /etc/ssh
(umask u=rw,g=r,o=r; cp ${../example_keys/system1.pub} /etc/ssh/ssh_host_ed25519_key.pub)
(
umask u=rw,g=,o=
cp ${../example_keys/system1} /etc/ssh/ssh_host_ed25519_key
touch /etc/ssh/ssh_host_rsa_key
)
'';
}