diff --git a/users/_common/programs/ssh.nix b/users/_common/programs/ssh.nix index 81b5ee2..93a0d65 100644 --- a/users/_common/programs/ssh.nix +++ b/users/_common/programs/ssh.nix @@ -19,8 +19,7 @@ programs.ssh = { enable = true; matchBlocks = { - github = { - hostname = "github.com"; + "github.com" = { identityFile = age.secrets.nix2github.path; }; }; diff --git a/users/root/configuration.nix b/users/root/configuration.nix index 136fa3f..59935d2 100644 --- a/users/root/configuration.nix +++ b/users/root/configuration.nix @@ -3,5 +3,13 @@ users.users.root = { initialPassword = "password1"; }; + + system.activationScripts.sshConfig = { + text = '' + mkdir -p /root/.ssh + ln -snf ${config.age.secrets.nix2github.path} /root/.ssh/nix2github + ln -snf /home/${settings.user.username}/.ssh/config /root/.ssh/config + ''; + }; }