wtf is happening

This commit is contained in:
= 2024-03-12 01:43:35 -05:00
parent 91e0976cda
commit 16da7ed48b
9 changed files with 58 additions and 21 deletions

View file

@ -0,0 +1,15 @@
{ settings, pkgs, ... }:
''
if [ ! -f $HOME/.ssh/id_ed25519 ]; then
if [ -v DRY_RUN ]; then
echo "DRY_RUN is set. Would generate SSH key for ${settings.user.username}."
else
echo "Generating SSH key for ${settings.user.username}."
mkdir -p $HOME/.ssh
chmod 700 $HOME/.ssh
${pkgs.openssh}/bin/ssh-keygen -t ed25519 -f $HOME/.ssh/id_ed25519 -N ""
fi
else
echo "SSH key already exists for ${settings.user.username}."
fi
''

View file

@ -0,0 +1,17 @@
{ lib, ... } @ args:
{
# We always want a standard ssh key-pair used for secret management, create it if not there.
home.activation.generateSshKey = lib.hm.dag.entryAfter [ "writeBoundary" ] (import ./generate_ssh_key.nix args);
programs.ssh = {
enable = true;
matchBlocks = {
github = {
hostname = "github.com";
# TODO lEFT OFF HERE TRYING TO GET THIS TO WORK
# identityFile = age.secrets.test1.file;
};
};
};
}