mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-07 08:14:08 +09:00
git
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
programs.ssh.startAgent = true;
|
||||
|
||||
home.packages = [ pkgs.openssh ];
|
||||
|
||||
home.activation.generateSshKey = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
key="$HOME/.ssh/id_ed25519"
|
||||
if [ ! -f "$key" ]; then
|
||||
umask 077
|
||||
mkdir -p "$HOME/.ssh"
|
||||
ssh-keygen -t ed25519 -N "" -f "$key" \
|
||||
-C "${config.home.username}@$(hostnamectl --static)"
|
||||
echo "Generated SSH key at $key"
|
||||
echo "Public key:"
|
||||
cat "$key.pub"
|
||||
fi
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user