From 378e3831e4bf3450436a3e0877ca5ec630404626 Mon Sep 17 00:00:00 2001 From: Victor Date: Sat, 30 Jul 2022 22:57:42 +0200 Subject: [PATCH] set hostname toplevel --- flake.nix | 6 +++++- nixos/hosts/olympus/bastion/configuration.nix | 2 -- nixos/hosts/olympus/database/configuration.nix | 2 -- nixos/hosts/olympus/dhcp/configuration.nix | 1 - nixos/hosts/olympus/dns/configuration.nix | 2 -- nixos/hosts/olympus/gitea/configuration.nix | 2 -- nixos/hosts/olympus/hedgedoc/configuration.nix | 2 -- nixos/hosts/olympus/k3s/configuration.nix | 2 -- nixos/hosts/olympus/minecraft/configuration.nix | 2 -- nixos/hosts/olympus/minio/configuration.nix | 2 -- nixos/hosts/olympus/mosquitto/configuration.nix | 2 -- nixos/hosts/olympus/nginx/configuration.nix | 2 -- nixos/hosts/olympus/synapse/configuration.nix | 2 -- nixos/hosts/olympus/unifi/configuration.nix | 2 -- nixos/hosts/olympus/vault/configuration.nix | 2 -- nixos/hosts/olympus/victoriametrics/configuration.nix | 2 -- nixos/hosts/olympus/wireguard/configuration.nix | 2 -- 17 files changed, 5 insertions(+), 32 deletions(-) diff --git a/flake.nix b/flake.nix index 3cb3feb..e9983bc 100644 --- a/flake.nix +++ b/flake.nix @@ -53,9 +53,13 @@ }; }; - mkColmenaHost = { ip, hostname, tags, ... }@host: { + mkColmenaHost = { ip, hostname, tags, location, ... }@host: { "${hostname}" = { imports = resolveImports host; + networking = { + hostName = hostname; + domain = location; + }; deployment = { inherit tags; targetHost = ip; diff --git a/nixos/hosts/olympus/bastion/configuration.nix b/nixos/hosts/olympus/bastion/configuration.nix index 5d9adbb..c79003f 100644 --- a/nixos/hosts/olympus/bastion/configuration.nix +++ b/nixos/hosts/olympus/bastion/configuration.nix @@ -28,8 +28,6 @@ in { boot.loader.grub.version = 2; boot.loader.grub.device = "/dev/sda"; - networking.hostName = "bastion"; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos/hosts/olympus/database/configuration.nix b/nixos/hosts/olympus/database/configuration.nix index 5e3f68f..7fb8861 100644 --- a/nixos/hosts/olympus/database/configuration.nix +++ b/nixos/hosts/olympus/database/configuration.nix @@ -9,8 +9,6 @@ in { imports = [ ]; - networking.hostName = "database"; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos/hosts/olympus/dhcp/configuration.nix b/nixos/hosts/olympus/dhcp/configuration.nix index 339f731..9c7db31 100644 --- a/nixos/hosts/olympus/dhcp/configuration.nix +++ b/nixos/hosts/olympus/dhcp/configuration.nix @@ -10,7 +10,6 @@ in { imports = [ ]; networking = { - hostName = "dhcp"; defaultGateway = "10.42.42.1"; nameservers = [ "10.42.42.15" "10.42.42.16" ]; interfaces.eth0 = { diff --git a/nixos/hosts/olympus/dns/configuration.nix b/nixos/hosts/olympus/dns/configuration.nix index 2dd32df..21b81a5 100644 --- a/nixos/hosts/olympus/dns/configuration.nix +++ b/nixos/hosts/olympus/dns/configuration.nix @@ -13,8 +13,6 @@ let in { imports = [ ]; - networking.hostName = "dns"; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos/hosts/olympus/gitea/configuration.nix b/nixos/hosts/olympus/gitea/configuration.nix index 848982f..f0cc409 100644 --- a/nixos/hosts/olympus/gitea/configuration.nix +++ b/nixos/hosts/olympus/gitea/configuration.nix @@ -6,8 +6,6 @@ { imports = [ ]; - networking.hostName = "gitea"; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos/hosts/olympus/hedgedoc/configuration.nix b/nixos/hosts/olympus/hedgedoc/configuration.nix index dbb8dd3..1f06d8d 100644 --- a/nixos/hosts/olympus/hedgedoc/configuration.nix +++ b/nixos/hosts/olympus/hedgedoc/configuration.nix @@ -11,8 +11,6 @@ in { imports = [ ]; - networking.hostName = "hedgedoc"; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos/hosts/olympus/k3s/configuration.nix b/nixos/hosts/olympus/k3s/configuration.nix index 8cba9eb..a6d715a 100644 --- a/nixos/hosts/olympus/k3s/configuration.nix +++ b/nixos/hosts/olympus/k3s/configuration.nix @@ -14,8 +14,6 @@ boot.kernel.sysctl."fs.inotify.max_user_instances" = 2147483647; # INT_MAX, dynamically limited based on available memory boot.kernel.sysctl."fs.inotify.max_user_watches" = 1048576; - networking.hostName = "k3s-node1"; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos/hosts/olympus/minecraft/configuration.nix b/nixos/hosts/olympus/minecraft/configuration.nix index 3b5fcf6..35a5844 100644 --- a/nixos/hosts/olympus/minecraft/configuration.nix +++ b/nixos/hosts/olympus/minecraft/configuration.nix @@ -6,8 +6,6 @@ { imports = [ ]; - networking.hostName = "minecraft"; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos/hosts/olympus/minio/configuration.nix b/nixos/hosts/olympus/minio/configuration.nix index ad3b26d..a73bf0b 100644 --- a/nixos/hosts/olympus/minio/configuration.nix +++ b/nixos/hosts/olympus/minio/configuration.nix @@ -10,8 +10,6 @@ let in { imports = [ ]; - networking.hostName = "minio"; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos/hosts/olympus/mosquitto/configuration.nix b/nixos/hosts/olympus/mosquitto/configuration.nix index 1fbe8b3..a30040e 100644 --- a/nixos/hosts/olympus/mosquitto/configuration.nix +++ b/nixos/hosts/olympus/mosquitto/configuration.nix @@ -8,8 +8,6 @@ in { imports = [ ]; - networking.hostName = "mosquitto"; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos/hosts/olympus/nginx/configuration.nix b/nixos/hosts/olympus/nginx/configuration.nix index d8c5afe..a9ccc83 100644 --- a/nixos/hosts/olympus/nginx/configuration.nix +++ b/nixos/hosts/olympus/nginx/configuration.nix @@ -24,8 +24,6 @@ let ''; in { - networking.hostName = "nginx"; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos/hosts/olympus/synapse/configuration.nix b/nixos/hosts/olympus/synapse/configuration.nix index 84d2e72..088fd81 100644 --- a/nixos/hosts/olympus/synapse/configuration.nix +++ b/nixos/hosts/olympus/synapse/configuration.nix @@ -11,8 +11,6 @@ in { imports = [ ]; - networking.hostName = "synapse"; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos/hosts/olympus/unifi/configuration.nix b/nixos/hosts/olympus/unifi/configuration.nix index c2e6d5d..b7cb490 100644 --- a/nixos/hosts/olympus/unifi/configuration.nix +++ b/nixos/hosts/olympus/unifi/configuration.nix @@ -7,8 +7,6 @@ { imports = [ ]; - networking.hostName = "unifi"; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos/hosts/olympus/vault/configuration.nix b/nixos/hosts/olympus/vault/configuration.nix index 9553941..23e416a 100644 --- a/nixos/hosts/olympus/vault/configuration.nix +++ b/nixos/hosts/olympus/vault/configuration.nix @@ -5,8 +5,6 @@ { config, pkgs, ... }: let port = 8200; in { - networking.hostName = "vault"; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos/hosts/olympus/victoriametrics/configuration.nix b/nixos/hosts/olympus/victoriametrics/configuration.nix index 2a5372f..57331a9 100644 --- a/nixos/hosts/olympus/victoriametrics/configuration.nix +++ b/nixos/hosts/olympus/victoriametrics/configuration.nix @@ -10,8 +10,6 @@ in { imports = [ ]; - networking.hostName = "victoriametrics"; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos/hosts/olympus/wireguard/configuration.nix b/nixos/hosts/olympus/wireguard/configuration.nix index 27236a2..16ffd62 100644 --- a/nixos/hosts/olympus/wireguard/configuration.nix +++ b/nixos/hosts/olympus/wireguard/configuration.nix @@ -7,8 +7,6 @@ let vs = config.vault-secrets.secrets; in { imports = [ ]; - networking.hostName = "wireguard"; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave