From 216cd53d704e8e76c8fef5daf218f834a9768870 Mon Sep 17 00:00:00 2001 From: kity Date: Thu, 26 Dec 2024 21:30:44 +0100 Subject: [PATCH] started adding config for nas --- hosts/strawberry/configuration.nix | 20 +++++++++++++++++ terraform/main.tf | 35 ++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 hosts/strawberry/configuration.nix create mode 100644 terraform/main.tf diff --git a/hosts/strawberry/configuration.nix b/hosts/strawberry/configuration.nix new file mode 100644 index 0000000..e844cd0 --- /dev/null +++ b/hosts/strawberry/configuration.nix @@ -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"; +} \ No newline at end of file diff --git a/terraform/main.tf b/terraform/main.tf new file mode 100644 index 0000000..925bdb2 --- /dev/null +++ b/terraform/main.tf @@ -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 = <