2024-01-02 14:45:09 +08:00
|
|
|
{ pkgs
|
|
|
|
, lib
|
|
|
|
, config
|
|
|
|
, ... }: with lib; let
|
2024-01-07 22:01:31 +08:00
|
|
|
cfg = config.global.id;
|
2024-01-02 14:45:09 +08:00
|
|
|
in {
|
2024-01-07 22:01:31 +08:00
|
|
|
options.global.id = mkOption {
|
2024-01-02 14:45:09 +08:00
|
|
|
type = with types; str;
|
|
|
|
description = "systemd machine id";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
|
|
|
environment.etc.machine-id.text = cfg + "\n";
|
|
|
|
networking.hostId = substring 0 8 cfg;
|
|
|
|
};
|
|
|
|
}
|