|
|
|
@ -403,6 +403,15 @@ let |
|
|
|
|
</itemizedlist> |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
hostidFile = pkgs.runCommand "gen-hostid" { preferLocalBuild = true; } '' |
|
|
|
|
hi="${cfg.hostId}" |
|
|
|
|
${if pkgs.stdenv.isBigEndian then '' |
|
|
|
|
echo -ne "\x''${hi:0:2}\x''${hi:2:2}\x''${hi:4:2}\x''${hi:6:2}" > $out |
|
|
|
|
'' else '' |
|
|
|
|
echo -ne "\x''${hi:6:2}\x''${hi:4:2}\x''${hi:2:2}\x''${hi:0:2}" > $out |
|
|
|
|
''} |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
in |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
@ -1383,16 +1392,8 @@ in |
|
|
|
|
domainname "${cfg.domain}" |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
environment.etc.hostid = mkIf (cfg.hostId != null) |
|
|
|
|
{ source = pkgs.runCommand "gen-hostid" { preferLocalBuild = true; } '' |
|
|
|
|
hi="${cfg.hostId}" |
|
|
|
|
${if pkgs.stdenv.isBigEndian then '' |
|
|
|
|
echo -ne "\x''${hi:0:2}\x''${hi:2:2}\x''${hi:4:2}\x''${hi:6:2}" > $out |
|
|
|
|
'' else '' |
|
|
|
|
echo -ne "\x''${hi:6:2}\x''${hi:4:2}\x''${hi:2:2}\x''${hi:0:2}" > $out |
|
|
|
|
''} |
|
|
|
|
''; |
|
|
|
|
}; |
|
|
|
|
environment.etc.hostid = mkIf (cfg.hostId != null) { source = hostidFile; }; |
|
|
|
|
boot.initrd.systemd.contents."/etc/hostid" = mkIf (cfg.hostId != null) { source = hostidFile; }; |
|
|
|
|
|
|
|
|
|
# static hostname configuration needed for hostnamectl and the |
|
|
|
|
# org.freedesktop.hostname1 dbus service (both provided by systemd) |
|
|
|
|