From 0167c84fd504241b9cc7da54a715abc5a968f09b Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Tue, 6 Oct 2020 00:22:19 +0200 Subject: [PATCH] wak on lan custom service --- systems/PC-Fixe/configuration.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/systems/PC-Fixe/configuration.nix b/systems/PC-Fixe/configuration.nix index fa4f1626c..656a57514 100644 --- a/systems/PC-Fixe/configuration.nix +++ b/systems/PC-Fixe/configuration.nix @@ -90,7 +90,18 @@ services.openssh.passwordAuthentication = false; services.openssh.forwardX11 = true; - services.wakeonlan.interfaces = [ { interface = "eno1"; method = "magicpacket"; } ]; + systemd.services = { + "wol" = { + description = "Wake-on-LAN"; + wantedBy = [ "multi-user.target" ]; + requires = [ "network.target" ]; + after = [ "network.target" ]; + script = '' + ${pkgs.ethtool}/sbin/ethtool -s eno1 wol g + ''; + serviceConfig.Type = "oneshot"; + }; + }; system.stateVersion = "20.03"; }