From 087011cc68bc0b8a955220ec400a6bad9d0819e9 Mon Sep 17 00:00:00 2001 From: Fritz Otlinghaus Date: Sun, 31 Jan 2021 12:33:27 +0100 Subject: [PATCH] nixos/wakeonlan: add types --- nixos/modules/services/networking/wakeonlan.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nixos/modules/services/networking/wakeonlan.nix b/nixos/modules/services/networking/wakeonlan.nix index 35ff67937fc..c9850d142aa 100644 --- a/nixos/modules/services/networking/wakeonlan.nix +++ b/nixos/modules/services/networking/wakeonlan.nix @@ -31,6 +31,20 @@ in 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";