set hostname before dhcp client runs

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

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
{ lib, pkgs, config, ...}:
let
inherit (lib) mkOption types;
inherit (pkgs.liminix.services) oneshot;
in {
options = {
hostname = mkOption {
default = "liminix";
type = types.nonEmptyStr;
};
};
config = {
services.hostname = oneshot {
name = "hostname";
up = "echo ${config.hostname} > /proc/sys/kernel/hostname";
down = "true";
};
};
}