This commit is contained in:
Osman Faruk Bayram 2025-02-19 10:52:16 +03:00
parent c2d6818744
commit 96e4afa3eb

View file

@ -9,9 +9,10 @@
vim # or some other editor, e.g. nano or neovim
# Some common stuff that people expect to have
#procps
procps
#killall
#diffutils
inetutils
findutils
utillinux
tzdata
@ -34,6 +35,10 @@
openssh
just
nh
(pkgs.writeShellScriptBin "sshd-start" ''
echo "Starting sshd on port 8022"
${pkgs.openssh}/bin/sshd
'')
];
# Backup etc files instead of failing to activate generation if a file already exists in /etc
@ -49,4 +54,21 @@
# Set your time zone
#time.timeZone = "Europe/Berlin";
build.activation.sshd = ''
if [ ! -e /etc/ssh/ssh_host_rsa_key ]; then
$VERBOSE_ECHO "Generating host keys..."
$DRY_RUN_CMD ${pkgs.openssh}/bin/ssh-keygen -t ed25519 -a 32 -f "/etc/ssh/ssh_host_ed25519_key" -N ""
fi
'';
environment.etc."ssh/sshd_config".text = ''
AcceptEnv LANG LC_*
KbdInteractiveAuthentication no
PasswordAuthentication no
PermitRootLogin no
Port 8022
PrintMotd no
'';
}