Skip to content

Commit 277917b

Browse files
Avoid error if machineId is null
1 parent 8a470b7 commit 277917b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

nixos-modules/microvm/system.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
text = lib.replaceString "-" "" config.microvm.machineId + "\n";
6565
};
6666
# Generate hostId from machine-id like systemd would do
67-
networking.hostId = lib.mkDefault (
67+
networking.hostId = lib.mkIf (config.microvm.machineId != null) (lib.mkDefault (
6868
builtins.substring 0 8 config.microvm.machineId
69-
);
69+
));
7070
};
7171
}

0 commit comments

Comments
 (0)