nb changes, add wol script to fw
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
./modules/podman.nix
|
||||
./modules/omada.nix
|
||||
./modules/ddclient.nix
|
||||
-/modules/wol.nix
|
||||
|
||||
# git
|
||||
./modules/gitea.nix
|
||||
@@ -70,6 +71,7 @@
|
||||
htop # to see the system load
|
||||
tcpdump # view network traffic
|
||||
vim # my preferred editor
|
||||
wol
|
||||
inotify-tools
|
||||
];
|
||||
|
||||
|
||||
19
hosts/fw.cloonar.com/modules/wol.nix
Normal file
19
hosts/fw.cloonar.com/modules/wol.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
wolScript = stdenv.mkDerivation {
|
||||
name = "wol-script";
|
||||
outputHashMode = "recursive";
|
||||
outputHashAlgo = "sha256";
|
||||
outputHash = sha256;
|
||||
builder = writeShellScript "wol-lease" ''
|
||||
IP=$(cat /var/lib/kea/dhcp4.leases | grep $1 | awk -F, '{print $1}' | tail -n 1);
|
||||
MAC=$(cat /var/lib/kea/dhcp4.leases | grep $1 | awk -F, '{print $2}' | tail -n 1);
|
||||
${pkgs.wol}/bin/wol -i $IP $MAC
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [
|
||||
wolScript
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user