initrd: Include hostname in udhcpc DHCP options#229488
initrd: Include hostname in udhcpc DHCP options#229488eduarrrd wants to merge 1 commit intoNixOS:masterfrom
Conversation
e415875 to
7004376
Compare
There was a problem hiding this comment.
| udhcpcHostnameArg = if cfg.udhcpc.hostName != "" | |
| then "-x hostname:${config.networking.hostName}" | |
| else ""; | |
| udhcpcHostnameArg = lib.optionalString (cfg.udhcpc.hostName != "") "-x hostname:${config.networking.hostName}"; |
There was a problem hiding this comment.
Also this should probably be rather a default or apply option.
There was a problem hiding this comment.
I've applied your suggestion, it's certainly cleaner.
Also this should probably be rather a default
What do you mean here? The value of the option has a sensible default already, no? Are you talking about some function I should be using that simplifies this?
or apply option.
I'm not sure what you mean by this. Some searching reveals a apply argument, but it doesn't seem official as per https://nixos.org/manual/nixos/unstable/index.html#sec-option-declarations
Does using it mean that value of cfg.udhcpc.hostName will be the string -x hostname:... ? If so, that makes re-use hard, no?
Use case: host discovery for remote unlock. E.g. * fixed address assigned based on the DHCP client's hostname (as opposed to e.g. MAC address) * automated DNS record creation/update based on the DHCP client's hostname
Use case: host discovery for remote unlock. E.g.
Tested using Tcpdump.
Description of changes
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)