From 2ad203ce1f4908141a6203a8de0d1b320d484187 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Mon, 21 Aug 2023 19:29:00 +0100 Subject: [PATCH] delete unused functoins in liminix-tools --- pkgs/liminix-tools/networking/default.nix | 7 --- pkgs/liminix-tools/networking/udhcpc.nix | 65 ----------------------- 2 files changed, 72 deletions(-) delete mode 100644 pkgs/liminix-tools/networking/udhcpc.nix diff --git a/pkgs/liminix-tools/networking/default.nix b/pkgs/liminix-tools/networking/default.nix index 84f4689..cadb1fc 100644 --- a/pkgs/liminix-tools/networking/default.nix +++ b/pkgs/liminix-tools/networking/default.nix @@ -37,13 +37,6 @@ in { } // { inherit (interface) device; }; - udhcpc = callPackage ./udhcpc.nix {}; - odhcpc = interface: { ... } @ args: longrun { - name = "${interface.device}.odhcp"; - run = "odhcpcd ${interface.device}"; - }; - dnsmasq = callPackage ./dnsmasq.nix {}; - hostapd = callPackage ./hostapd.nix {}; route = { name, target, via, dependencies, dev ? null }: let with_dev = if dev != null then "dev ${dev}" else ""; in oneshot { diff --git a/pkgs/liminix-tools/networking/udhcpc.nix b/pkgs/liminix-tools/networking/udhcpc.nix deleted file mode 100644 index c518f0e..0000000 --- a/pkgs/liminix-tools/networking/udhcpc.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ - liminix -, writeAshScript -, serviceFns -} : -let - inherit (liminix.services) longrun; -in -interface: { dependencies ? [] } @ args: -let - name = "${interface.device}.udhcp"; - script = writeAshScript "udhcp-notify" { - # runtimeInputs = [ iproute2 ] using busybox version of ip - } '' - . ${serviceFns} - exec 2>&1 - action=$1 - - set_address() { - ip address replace $ip/$mask dev $interface - (in_outputs ${name} - for i in lease mask ip router siaddr dns serverid subnet opt53 interface ; do - printenv $i > $i - done) - } - case $action in - deconfig) - ip address flush $interface - ip link set up dev $interface - ;; - bound) - # this doesn't actually replace, it adds a new address. - set_address - echo >/proc/self/fd/10 - ;; - renew) - set_address - ;; - nak) - echo "received NAK on $interface" - ;; - esac - ''; -in longrun { - inherit name; - run = "/bin/udhcpc -f -i ${interface.device} -x hostname:$(cat /proc/sys/kernel/hostname) -s ${script}"; - notification-fd = 10; - dependencies = [ interface ] ++ dependencies; -} - -# lease=86400 -# mask=24 -# ip=10.0.2.15 -# router=10.0.2.2 -# siaddr=10.0.2.2 -# dns=10.0.2.3 -# serverid=10.0.2.2 -# subnet=255.255.255.0 -# SHLVL=2 -# opt53=05 -# interface=eth0 -# PATH=/nix/store/npy692wik809z3vdwrkrj2wixjkr33kp-busybox-mips-unknown-linux-musl-1.35.0/bin:/nix/store/ -# pj0b27l5728cypa5mmagz0q8ibzpik0h-execline-mips-unknown-linux-musl-2.9.0.1-bin/bin:/nix/store/rfjiw4dnv29daqc9971qmica1h86l0s0-s6-linux-init-mips-unknown-linux-musl-1.0.8.0-bin/bin:/nix/store/4wn3jm7yy2gfi0is0yy75lifbq5zjwz7-s6-rc-mips-unknown-linux-musl-0.5.3.2-bin/bin:/usr/bin:/bin -# _=/nix/store/npy692wik809z3vdwrkrj2wixjkr33kp-busybox-mips-unknown-linux-musl-1.35.0/bin/env -# /