mirror of
https://github.com/harryssecret/homelab-nix.git
synced 2025-08-08 06:30:18 +02:00
added config for vps
This commit is contained in:
parent
4ca8718643
commit
5390d4a471
3 changed files with 23 additions and 30 deletions
0
hosts/athena/configuration.nix
Normal file
0
hosts/athena/configuration.nix
Normal file
4
terraform/cloud-config.yaml
Normal file
4
terraform/cloud-config.yaml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#cloud-config
|
||||||
|
|
||||||
|
runcmd:
|
||||||
|
- curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | PROVIDER=hetznercloud NIX_CHANNEL=nixos-23.05 bash 2>&1 | tee /tmp/infect.log
|
|
@ -1,35 +1,24 @@
|
||||||
provider "proxmox" {
|
variable "hcloud_token" {
|
||||||
pm_api_url = "https://your-proxmox-server:8006/api2/json"
|
sensitive = true
|
||||||
pm_tls_insecure = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "proxmox_vm_qemu" "nixos-services-vm" {
|
provider "hcloud" {
|
||||||
name = "nixos-services-vm"
|
token = var.hcloud_token
|
||||||
target_node = "pve"
|
project = "homelab"
|
||||||
clone = "template-name"
|
|
||||||
os_type = "cloud-init"
|
|
||||||
cores = 2
|
|
||||||
memory = 2048
|
|
||||||
disk {
|
|
||||||
size = "10G"
|
|
||||||
}
|
|
||||||
network {
|
|
||||||
model = "virtio"
|
|
||||||
bridge = "vmbr0"
|
|
||||||
}
|
|
||||||
sshkeys = file("~/.ssh/id_rsa.pub")
|
|
||||||
ipconfig0 = "ip=dhcp"
|
|
||||||
cloud_init {
|
|
||||||
user_data = <<EOF
|
|
||||||
#cloud-config
|
|
||||||
users:
|
|
||||||
- name: nixos
|
|
||||||
ssh-authorized-keys:
|
|
||||||
- ${file("~/.ssh/id_rsa.pub")}
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
output "nixos_vm_ip" {
|
resource "hcloud_server" {
|
||||||
value = proxmox_vm_qemu.nixos_vm.network.0.ip
|
name = "athena"
|
||||||
|
type = "cax11"
|
||||||
|
image = "debian-12"
|
||||||
|
datacenter = "nbg1-dc3"
|
||||||
|
}
|
||||||
|
|
||||||
|
data "cloudinit_config" "athena" {
|
||||||
|
part {
|
||||||
|
filename = "cloud-config.yaml"
|
||||||
|
content_type = "text/cloud-config"
|
||||||
|
|
||||||
|
content = file("${path.module}/cloud-config.yaml")
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue