feat: Link SSH keys into ~/{public,private}-keys

This commit is contained in:
Madeleine Sydney
2025-02-21 21:14:41 -07:00
parent c738bed3d8
commit 441405a7bc
2 changed files with 17 additions and 1 deletions

View File

@@ -3,10 +3,22 @@
let mutableSymlink = config.lib.file.mkOutOfStoreSymlink;
in lib.mkMerge [
{
# Link private SSH keys to ~/.ssh/id_ed25519 (where SSH will automatically
# find them) and ~/private-keys (where humans will find them). Remember
# that private keys must always be linked with mutable symlinks as to not
# copy them into the world-readable Nix store!!
home.file.".ssh/id_ed25519".source =
mutableSymlink "/persist/private-keys/ssh/crumb-at-nixos-testbed";
home.file."private-keys/ssh/crumb-at-nixos-testbed".source =
mutableSymlink "/persist/private-keys/ssh/crumb-at-nixos-testbed";
# Similarly, public keys are linked where SSH will find them as well as a
# human-friendly ~/public-keys.
home.file.".ssh/id_ed25519.pub".source =
../../public-keys/ssh/crumb-at-nixos-testbed.pub;
home.file."public-keys/ssh/crumb-at-nixos-testbed".source =
../../public-keys/ssh/crumb-at-nixos-testbed.pub;
}
{