diff --git a/flake.nix b/flake.nix index 375da28..6e7936a 100644 --- a/flake.nix +++ b/flake.nix @@ -191,6 +191,15 @@ ./hosts/kanidm01 ]; }; + monitoring02 = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs self; + }; + modules = commonModules ++ [ + ./hosts/monitoring02 + ]; + }; }; packages = forAllSystems ( { pkgs }: diff --git a/hosts/monitoring02/configuration.nix b/hosts/monitoring02/configuration.nix new file mode 100644 index 0000000..3065a0c --- /dev/null +++ b/hosts/monitoring02/configuration.nix @@ -0,0 +1,72 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ + ../template2/hardware-configuration.nix + + ../../system + ../../common/vm + ]; + + # Host metadata (adjust as needed) + homelab.host = { + tier = "test"; # Start in test tier, move to prod after validation + }; + + # Enable Vault integration + vault.enable = true; + + # Enable remote deployment via NATS + homelab.deploy.enable = true; + + nixpkgs.config.allowUnfree = true; + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/vda"; + + networking.hostName = "monitoring02"; + networking.domain = "home.2rjus.net"; + networking.useNetworkd = true; + networking.useDHCP = false; + services.resolved.enable = true; + networking.nameservers = [ + "10.69.13.5" + "10.69.13.6" + ]; + + systemd.network.enable = true; + systemd.network.networks."ens18" = { + matchConfig.Name = "ens18"; + address = [ + "10.69.13.24/24" + ]; + routes = [ + { Gateway = "10.69.13.1"; } + ]; + linkConfig.RequiredForOnline = "routable"; + }; + time.timeZone = "Europe/Oslo"; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + nix.settings.tarball-ttl = 0; + environment.systemPackages = with pkgs; [ + vim + wget + git + ]; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + networking.firewall.enable = false; + + system.stateVersion = "25.11"; # Did you read the comment? +} \ No newline at end of file diff --git a/hosts/monitoring02/default.nix b/hosts/monitoring02/default.nix new file mode 100644 index 0000000..57ed4b4 --- /dev/null +++ b/hosts/monitoring02/default.nix @@ -0,0 +1,5 @@ +{ ... }: { + imports = [ + ./configuration.nix + ]; +} \ No newline at end of file diff --git a/terraform/vault/hosts-generated.tf b/terraform/vault/hosts-generated.tf index 6286e1a..c33e31e 100644 --- a/terraform/vault/hosts-generated.tf +++ b/terraform/vault/hosts-generated.tf @@ -39,6 +39,11 @@ locals { "secret/data/kanidm/*", ] } + "monitoring02" = { + paths = [ + "secret/data/hosts/monitoring02/*", + ] + } } diff --git a/terraform/vms.tf b/terraform/vms.tf index 57db81e..37efc10 100644 --- a/terraform/vms.tf +++ b/terraform/vms.tf @@ -79,6 +79,13 @@ locals { disk_size = "20G" vault_wrapped_token = "s.OOqjEECeIV7dNgCS6jNmyY3K" } + "monitoring02" = { + ip = "10.69.13.24/24" + cpu_cores = 4 + memory = 4096 + disk_size = "20G" + vault_wrapped_token = "s.uXpdoGxHXpWvTsGbHkZuq1jF" + } } # Compute VM configurations with defaults applied