fix(modules/hostname): hash the hostname to avoid duplicate services in the db

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
This commit is contained in:
Raito Bezarius 2024-09-08 00:31:15 +02:00
parent 6970d811e8
commit 8ac3e32b8b

View file

@ -15,7 +15,7 @@ in {
}; };
config = { config = {
services.hostname = oneshot { services.hostname = oneshot {
name = "hostname"; name = "hostname-${builtins.substring 0 12 (builtins.hashString "sha256" config.hostname)}";
up = "echo ${config.hostname} > /proc/sys/kernel/hostname"; up = "echo ${config.hostname} > /proc/sys/kernel/hostname";
down = "true"; down = "true";
}; };