diff --git a/configuration.nix b/configuration.nix index 647ff31..dd72fb4 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,8 +1,8 @@ { - inputs, lib, config, pkgs, + modulesPath, ... }: let @@ -20,21 +20,53 @@ let fixupPhase = ""; }; instance = builtins.fromJSON (builtins.readFile "/etc/tjo.cloud/meta.json"); - - base_configuration = pkgs.fetchurl { - url = ""; - sha256 = ""; - }; in { system.stateVersion = "24.05"; - # FIXME: Also import the pre-defined generator config. + ## FROM infrastructure/proxmox.tjo.cloud/configuration.nix + # Couldn't figure out the import to work. imports = [ - base_configuration + "${toString modulesPath}/profiles/qemu-guest.nix" ]; + fileSystems."/" = { + device = "/dev/disk/by-label/nixos"; + autoResize = true; + fsType = "ext4"; + }; + fileSystems."/boot" = { + device = "/dev/disk/by-label/ESP"; + fsType = "vfat"; + }; + boot.growPartition = true; + boot.kernelParams = [ "console=ttyS0" ]; + boot.loader.systemd-boot.enable = true; + boot.loader.timeout = 0; + services.qemuGuest.enable = true; + services.cloud-init = { + enable = true; + network.enable = true; + settings = lib.mkOptionDefault { + datasource = { + NoCloud = { }; + ConfigDrive = { }; + }; + }; + }; + networking.useNetworkd = true; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + environment.systemPackages = [ pkgs.nginx ]; + ## END FROM nix.nixPath = [ "nixos-config=/etc/tjo.cloud/configuration.nix" ]; + system.autoUpgrade = { + enable = true; + dates = "06:00"; + randomizedDelaySec = "45min"; + }; # NETWORK networking.hostName = instance.name; diff --git a/terraform/node.tf b/terraform/node.tf index 733c0cf..eee2d72 100644 --- a/terraform/node.tf +++ b/terraform/node.tf @@ -28,8 +28,8 @@ locals { k => merge(v, { public_ipv4 = local.ipv4_addresses[k]["ens18"][0] public_ipv6 = local.ipv6_addresses[k]["ens18"][0] - internal_ipv4 = local.ipv4_addresses[k]["tailscale0"][0] - internal_ipv6 = local.ipv6_addresses[k]["tailscale0"][0] + internal_ipv4 = "" # local.ipv4_addresses[k]["tailscale0"][0] + internal_ipv6 = "" # local.ipv6_addresses[k]["tailscale0"][0] #internal_ipv4 = data.tailscale_device.ingress[k].addresses[0] #internal_ipv6 = data.tailscale_device.ingress[k].addresses[1] }) diff --git a/terraform/variables.tf b/terraform/variables.tf index cbd89ca..3c30b93 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -6,7 +6,7 @@ variable "nodes" { bridge = string cores = optional(number, 1) - memory = optional(number, 1024) + memory = optional(number, 3072) storage = optional(string, "main") boot_size = optional(number, 8)