From 47d462ba76c2306d1f1486c574a98c45160c2bdf Mon Sep 17 00:00:00 2001 From: 2mal3 <56305732+2mal3@users.noreply.github.com> Date: Sat, 17 Jan 2026 15:17:12 +0100 Subject: [PATCH] fix(nixos): wol broken --- nixos/configuration.nix | 11 +++++++++++ nixos/wol.nu | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 nixos/wol.nu diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 45407a7..9ec3bfc 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -152,6 +152,17 @@ }; }; + systemd.services.enable-wol = { + wantedBy = ["multi-user.target"]; + after = ["network.target"]; + path = with pkgs; [ ethtool nushell ]; + script = "nu ${./wol.nu}"; + serviceConfig = { + Type = "oneshot"; + User = "root"; + }; + }; + systemd.tmpfiles.rules = [ "d /home/mudics/mudics 0755 mudics - -" ]; diff --git a/nixos/wol.nu b/nixos/wol.nu new file mode 100644 index 0000000..00305de --- /dev/null +++ b/nixos/wol.nu @@ -0,0 +1,11 @@ +#!/usr/bin/env nu + +ls /sys/class/net | get name | path basename | where $it != "lo" | each {|iface| + print $"Enabling WoL on ($iface)..." + try { + ethtool -s $iface wol g + print $"Successfully enabled WoL on ($iface)" + } catch { + print $"Failed to enable WoL on ($iface). It might not be supported." + } +}