Commit f5f1751b authored by Majiir Paktu's avatar Majiir Paktu
Browse files

refactor: combine scripted and networkd WakeOnLan config

parent d290c309
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -61,8 +61,6 @@ let
          MACAddress = i.macAddress;
        } // optionalAttrs (i.mtu != null) {
          MTUBytes = toString i.mtu;
        } // optionalAttrs (i.wakeOnLan.enable == true) {
          WakeOnLan = concatStringsSep " " i.wakeOnLan.policy;
        };
      };
    in listToAttrs (map createNetworkLink interfaces);
+0 −10
Original line number Diff line number Diff line
@@ -389,16 +389,6 @@ in
        };
      })))
      vlanNetworks
      {
        systemd.network.links = pipe interfaces [
          (filter (i: i.wakeOnLan.enable))
          (map (i: nameValuePair "40-${i.name}" {
            matchConfig.OriginalName = i.name;
            linkConfig.WakeOnLan = concatStringsSep " " i.wakeOnLan.policy;
          }))
          listToAttrs
        ];
      }
    ];

    # We need to prefill the slaved devices with networking options
+10 −0
Original line number Diff line number Diff line
@@ -1460,6 +1460,16 @@ in
      ]
      ++ bridgeStp;

    # Wake-on-LAN configuration is shared by the scripted and networkd backends.
    systemd.network.links = pipe interfaces [
      (filter (i: i.wakeOnLan.enable))
      (map (i: nameValuePair "40-${i.name}" {
        matchConfig.OriginalName = i.name;
        linkConfig.WakeOnLan = concatStringsSep " " i.wakeOnLan.policy;
      }))
      listToAttrs
    ];

    # The network-interfaces target is kept for backwards compatibility.
    # New modules must NOT use it.
    systemd.targets.network-interfaces =