working on the stateless kiosk, dynamic hostnames work now!

This commit is contained in:
UGA Innovation Factory
2025-12-12 16:46:31 -05:00
parent d583fac582
commit 5ba8dce77b
3 changed files with 27 additions and 37 deletions

View File

@@ -30,8 +30,8 @@ in
systemd.services.dynamic-hostname = {
description = "Set hostname based on MAC address";
wantedBy = [ "sysinit.target" ];
wants = [ "default.target" ];
after = [ "default.target" ];
before = [ "network-pre.target" ];
wants = [ "network-pre.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
@@ -44,10 +44,11 @@ in
case "$MAC" in
${shellCases}
*) NEW_HOST="nix-station-unregistered" ;;
*) NEW_HOST="nix-station-anon" ;;
esac
${pkgs.nettools}/bin/hostname "$NEW_HOST"
'';
};
};