mirror of
https://github.com/harryssecret/homelab-nix.git
synced 2025-01-18 05:19:33 +01:00
started adding config for nas
This commit is contained in:
parent
7e57ead3c5
commit
216cd53d70
20
hosts/strawberry/configuration.nix
Normal file
20
hosts/strawberry/configuration.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{pkgs, username, ...}: {
|
||||
services.samba = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
users.users.nas = {
|
||||
|
||||
};
|
||||
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
};
|
||||
|
||||
systemd.tempfiles.rules = [
|
||||
"d /srv/files 0755 nas nas"
|
||||
];
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
}
|
35
terraform/main.tf
Normal file
35
terraform/main.tf
Normal file
|
@ -0,0 +1,35 @@
|
|||
provider "proxmox" {
|
||||
pm_api_url = "https://your-proxmox-server:8006/api2/json"
|
||||
pm_tls_insecure = true
|
||||
}
|
||||
|
||||
resource "proxmox_vm_qemu" "nixos-services-vm" {
|
||||
name = "nixos-services-vm"
|
||||
target_node = "pve"
|
||||
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" {
|
||||
value = proxmox_vm_qemu.nixos_vm.network.0.ip
|
||||
}
|
Loading…
Reference in a new issue