ryzensun: enable wake-on-lan

This commit is contained in:
teutat3s 2024-06-13 01:59:25 +02:00
parent 39a62122c9
commit cdfe4d6bcb
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
2 changed files with 27 additions and 1 deletions

View file

@ -23,6 +23,8 @@
"10.0.1.208" = ["cn07.lev-1"]; "10.0.1.208" = ["cn07.lev-1"];
}; };
interfaces.enp4s0.wakeOnLan.enable = true;
wireguard.enable = true; wireguard.enable = true;
wg-quick.interfaces = { wg-quick.interfaces = {
wg0 = { wg0 = {

View file

@ -5,7 +5,7 @@
flake, flake,
... ...
}: }:
with lib; let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
xdg = config.home-manager.users."${psCfg.user.name}".xdg; xdg = config.home-manager.users."${psCfg.user.name}".xdg;
in { in {
@ -28,6 +28,30 @@ in {
boot.binfmt.emulatedSystems = ["aarch64-linux"]; boot.binfmt.emulatedSystems = ["aarch64-linux"];
# Required for WakeOnLan
boot.kernelParams = [ "ip=dhcp" ];
boot.initrd = {
availableKernelModules = [ "r8169" ];
network = {
enable = true;
ssh = {
enable = true;
# To prevent ssh clients from freaking out because a different host key is used,
# a different port for ssh is useful (assuming the same host has also a regular sshd running)
port = 2222;
# Please create this manually the first time.
# sudo ssh-keygen -t ed25519 -N "" -f /etc/secrets/initrd/ssh_host_ed25519_key
hostKeys = [ "/etc/secrets/initrd/ssh_host_ed25519_key" ];
authorizedKeys = psCfg.user.publicKeys;
};
postCommands = ''
# Automatically ask for the password on SSH login
echo 'cryptsetup-askpass || echo "Unlock was successful; exiting SSH session" && exit 1' >> /root/.profile
'';
};
};
services.fstrim.enable = true; services.fstrim.enable = true;
services.tailscale.enable = true; services.tailscale.enable = true;