refactor ssh

This commit is contained in:
Daniel Langbein 2023-08-31 14:07:09 +02:00
parent 67f39294de
commit bf1585fdad
2 changed files with 24 additions and 15 deletions

View File

@ -7,6 +7,7 @@ in
imports = [ imports = [
(import "${home-manager}/nixos") (import "${home-manager}/nixos")
./git.home.nix ./git.home.nix
./nitrokey-ssh-gpg.home.nix
]; ];
/* Enable home-manager to configure GNOME */ /* Enable home-manager to configure GNOME */
@ -28,21 +29,6 @@ in
# defaultCacheTtl = 1800; # defaultCacheTtl = 1800;
#}; #};
programs.ssh = {
enable = true;
userKnownHostsFile = "~/.ssh/known_hosts ${../known_hosts}";
matchBlocks = {
"nas" = {
hostname = "p1st.de";
user = "yoda";
port = 2222;
compression = true;
# TODO
#preferredAuthentication = "publickey";
};
};
};
# TODO: See history.path below. # TODO: See history.path below.
# xdg = { # xdg = {
# enable = true; # enable = true;

View File

@ -0,0 +1,23 @@
{ config, pkgs, ... }:
{
home-manager.users.yoda = {
programs.ssh = {
enable = true;
userKnownHostsFile = "~/.ssh/known_hosts ${../ssh/known_hosts}";
matchBlocks = {
"nas" = {
hostname = "p1st.de";
user = "yoda";
port = 2222;
compression = true;
#identityFile = "pubkey_nitrokey_ssh.pub";
#identitiesOnly = true;
};
};
};
};
}