diff --git a/morph/make-storage.nix b/morph/make-storage.nix index 85c3e315a1fc267a9bfa4511aefff710457bb12b..768cdb55f304ef0708a2af434df772861572502d 100644 --- a/morph/make-storage.nix +++ b/morph/make-storage.nix @@ -38,8 +38,6 @@ ../nixos/modules/private-storage.nix ]; - networking.hostId = "00000001"; - # Pass the configuration specific to this host to the 100TB module to be # expanded into a complete system configuration. See the 100tb module for # handling of this value. diff --git a/morph/storage001-config.nix b/morph/storage001-config.nix index 2c4cd7678cc2a19713508dc0711f749e04dbec70..2e6e21548c978f8d41e5856af03caa64124864de 100644 --- a/morph/storage001-config.nix +++ b/morph/storage001-config.nix @@ -1,4 +1,5 @@ -{ "interface" = "eno1"; +{ "hostId" = "00000001"; + "interface" = "eno1"; "publicIPv4" = "176.113.72.38"; "prefixLength" = 30; "gateway" = "176.113.72.37"; diff --git a/nixos/modules/100tb.nix b/nixos/modules/100tb.nix index 243da0dd72913ed4f582b52ca5cfe0494936c744..b56bd06e23d70ddd25ad8c53c736919945d6c0f4 100644 --- a/nixos/modules/100tb.nix +++ b/nixos/modules/100tb.nix @@ -32,6 +32,11 @@ let # values. This value is in the `let` to make the code below a little easier # to read. See below where we use it. options = { + hostId = lib.mkOption + { type = lib.types.str; + example = lib.literalExample "abcdefgh"; + description = "The 32-bit host ID of the machine, formatted as 8 hexadecimal characters."; + }; interface = lib.mkOption { type = lib.types.str; example = lib.literalExample "eno0"; @@ -113,6 +118,7 @@ in { cfg.rootPublicKey ]; + networking.hostId = cfg.hostId; networking.dhcpcd.enable = false; networking.interfaces = { "${cfg.interface}".ipv4.addresses = [