From 2689a3927af70fb68c9bf8a48bd2f594a978b1d4 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 12 Mar 2024 03:43:06 -0500 Subject: [PATCH] update ssh for root --- users/_common/programs/ssh.nix | 3 +-- users/root/configuration.nix | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) 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 + ''; + }; }