diff --git a/examples/rotuer.nix b/examples/rotuer.nix index d37ece1..3133c88 100644 --- a/examples/rotuer.nix +++ b/examples/rotuer.nix @@ -284,13 +284,12 @@ in rec { services.dhcp6 = let name = "dhcp6c.wan"; - luafile = writeFennelScript "odhcpc-script" [] ./odhcp6-script.fnl; in longrun { inherit name; notification-fd = 10; run = '' export SERVICE_STATE=/run/service-state/${name} - ${pkgs.odhcp6c}/bin/odhcp6c -s ${luafile} -e -v -p /run/${name}.pid -P 48 $(output ${services.wan} ifname) + ${pkgs.odhcp6c}/bin/odhcp6c -s ${pkgs.odhcp-script} -e -v -p /run/${name}.pid -P 48 $(output ${services.wan} ifname) ) ''; dependencies = [ services.wan ]; diff --git a/pkgs/default.nix b/pkgs/default.nix index 8b8db76..10329ee 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -55,4 +55,5 @@ hi = callPackage ./hi {}; firewallgen = callPackage ./firewallgen {}; kernel-modules = callPackage ./kernel-modules {}; + odhcp-script = callPackage ./odhcp-script {}; } diff --git a/pkgs/odhcp-script/default.nix b/pkgs/odhcp-script/default.nix new file mode 100644 index 0000000..02a671d --- /dev/null +++ b/pkgs/odhcp-script/default.nix @@ -0,0 +1,4 @@ +{ + writeFennelScript +}: +writeFennelScript "odhcpc-script" [] ./odhcp6-script.fnl diff --git a/examples/odhcp6-script.fnl b/pkgs/odhcp-script/odhcp6-script.fnl similarity index 100% rename from examples/odhcp6-script.fnl rename to pkgs/odhcp-script/odhcp6-script.fnl