From 9aa5ff6ed12078a2c5aa66a2fc9513d8b68f735a Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Fri, 30 Jun 2023 20:02:03 +0100 Subject: [PATCH] make a package for odhcpc-script --- examples/rotuer.nix | 3 +-- pkgs/default.nix | 1 + pkgs/odhcp-script/default.nix | 4 ++++ {examples => pkgs/odhcp-script}/odhcp6-script.fnl | 0 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 pkgs/odhcp-script/default.nix rename {examples => pkgs/odhcp-script}/odhcp6-script.fnl (100%) 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