From 355cad6574256ca7c069181588940ecc563c36ed Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Wed, 3 Dec 2025 22:16:05 +0100 Subject: [PATCH] fix: try 'writeShellApplication' for 'astyanax' WOL script --- hosts/andromache/default.nix | 3 ++- hosts/andromache/wol-interfaces.nix | 3 +++ hosts/astyanax/default.nix | 12 +++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 hosts/andromache/wol-interfaces.nix diff --git a/hosts/andromache/default.nix b/hosts/andromache/default.nix index 8569fe2..c58c952 100644 --- a/hosts/andromache/default.nix +++ b/hosts/andromache/default.nix @@ -8,6 +8,7 @@ let username = "h"; + wolInterfaces = import ./wol-interfaces.nix; in { imports = [ @@ -125,7 +126,7 @@ in interfaces = { eno1 = { wakeOnLan.enable = true; - macAddress = "02:68:b3:29:da:98"; + macAddress = wolInterfaces.eno1.macAddress; }; }; firewall = { diff --git a/hosts/andromache/wol-interfaces.nix b/hosts/andromache/wol-interfaces.nix new file mode 100644 index 0000000..51ad843 --- /dev/null +++ b/hosts/andromache/wol-interfaces.nix @@ -0,0 +1,3 @@ +{ + eno1.macAddress = "02:68:b3:29:da:98"; +} diff --git a/hosts/astyanax/default.nix b/hosts/astyanax/default.nix index ecbdd17..98e47fd 100644 --- a/hosts/astyanax/default.nix +++ b/hosts/astyanax/default.nix @@ -9,6 +9,7 @@ let username = "h"; hostName = "astyanax"; + wolInterfaces = import ../andromache/wol-interfaces.nix; in { imports = [ @@ -43,7 +44,16 @@ in secrets.username = username; - environment.systemPackages = [ inputs.nvim.packages.x86_64-linux.nvim ]; + environment.systemPackages = [ + inputs.nvim.packages.x86_64-linux.nvim + (pkgs.writeShellApplication { + name = "wol-andromache"; + runtimeInputs = [ pkgs.wakeonlan ]; + text = '' + wakeonlan ${wolInterfaces.eno1.macAddress} + ''; + }) + ]; home-manager = { useGlobalPkgs = true;