set hostname before dhcp client runs

This commit is contained in:
Daniel Barlow
2023-03-08 22:11:59 +00:00
parent 2318c54037
commit 91c0147919
4 changed files with 30 additions and 5 deletions

View File

@@ -7,7 +7,7 @@
let
inherit (liminix.services) longrun;
in
interface: { ... } @ args:
interface: { dependencies ? [] } @ args:
let
name = "${interface.device}.udhcp";
script = writeAshScript "udhcp-notify" {
@@ -43,9 +43,9 @@ let
'';
in longrun {
inherit name;
run = "${busybox}/bin/udhcpc -f -i ${interface.device} -s ${script}";
run = "${busybox}/bin/udhcpc -f -i ${interface.device} -x hostname:$(cat /proc/sys/kernel/hostname) -s ${script}";
notification-fd = 10;
dependencies = [ interface ];
dependencies = [ interface ] ++ dependencies;
}
# lease=86400