feat(nixos/ssh): enable openssh and persist host keys
This commit is contained in:
parent
3bffa8760e
commit
343c802e6d
1 changed files with 0 additions and 28 deletions
|
@ -1,28 +0,0 @@
|
||||||
{ config, lib, ... }:
|
|
||||||
let
|
|
||||||
cfg = config.flake;
|
|
||||||
inherit (lib.modules) mkMerge;
|
|
||||||
inherit (cfg.lib.modules) forAllUsers';
|
|
||||||
in
|
|
||||||
{
|
|
||||||
flake.modules.nixos.default = mkMerge [
|
|
||||||
{
|
|
||||||
persistFiles = [
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key"
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
|
||||||
];
|
|
||||||
users.users = forAllUsers' (_: value: { openssh.authorizedKeys.keys = [ value.pubkey ]; });
|
|
||||||
}
|
|
||||||
{ users.users.root.openssh.authorizedKeys.keys = [ cfg.admin.pubkey ]; }
|
|
||||||
];
|
|
||||||
flake.modules.homeManager.default = {
|
|
||||||
persistDirs = [ ".ssh" ];
|
|
||||||
programs.ssh.enable = true;
|
|
||||||
programs.ssh.extraConfig = ''
|
|
||||||
Host *
|
|
||||||
SetEnv TERM=xterm-256color
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue