From 31f04fec3c4c993d75ea4c7243fbc57103525282 Mon Sep 17 00:00:00 2001 From: legendofmiracles Date: Sat, 2 Oct 2021 09:41:02 -0600 Subject: [PATCH] nixos/wakeonlan: remove --- nixos/modules/module-list.nix | 1 - .../modules/services/networking/wakeonlan.nix | 70 ------------------- 2 files changed, 71 deletions(-) delete mode 100644 nixos/modules/services/networking/wakeonlan.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index bff7b83ea711..16a863a649c3 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -878,7 +878,6 @@ ./services/video/unifi-video.nix ./services/networking/v2ray.nix ./services/networking/vsftpd.nix - ./services/networking/wakeonlan.nix ./services/networking/wasabibackend.nix ./services/networking/websockify.nix ./services/networking/wg-quick.nix diff --git a/nixos/modules/services/networking/wakeonlan.nix b/nixos/modules/services/networking/wakeonlan.nix deleted file mode 100644 index c6291366b0f1..000000000000 --- a/nixos/modules/services/networking/wakeonlan.nix +++ /dev/null @@ -1,70 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - interfaces = config.services.wakeonlan.interfaces; - - ethtool = "${pkgs.ethtool}/sbin/ethtool"; - - passwordParameter = password : if (password == "") then "" else - "sopass ${password}"; - - methodParameter = {method, password} : - if method == "magicpacket" then "wol g" - else if method == "password" then "wol s so ${passwordParameter password}" - else throw "Wake-On-Lan method not supported"; - - line = { interface, method ? "magicpacket", password ? "" }: '' - ${ethtool} -s ${interface} ${methodParameter {inherit method password;}} - ''; - - concatStrings = foldr (x: y: x + y) ""; - lines = concatStrings (map (l: line l) interfaces); - -in -{ - - ###### interface - - options = { - - services.wakeonlan.interfaces = mkOption { - default = [ ]; - type = types.listOf (types.submodule { options = { - interface = mkOption { - type = types.str; - description = "Interface to enable for Wake-On-Lan."; - }; - method = mkOption { - type = types.enum [ "magicpacket" "password"]; - description = "Wake-On-Lan method for this interface."; - }; - password = mkOption { - type = types.strMatching "[a-fA-F0-9]{2}:([a-fA-F0-9]{2}:){4}[a-fA-F0-9]{2}"; - description = "The password has the shape of six bytes in hexadecimal separated by a colon each."; - }; - };}); - example = [ - { - interface = "eth0"; - method = "password"; - password = "00:11:22:33:44:55"; - } - ]; - description = '' - Interfaces where to enable Wake-On-LAN, and how. Two methods available: - "magicpacket" and "password". The password has the shape of six bytes - in hexadecimal separated by a colon each. For more information, - check the ethtool manual. - ''; - }; - - }; - - - ###### implementation - - config.powerManagement.powerUpCommands = lines; - -}