try giving up and going back to ubuntu vm

This commit is contained in:
Noah Masur
2025-07-01 00:40:33 -04:00
parent 18b489592e
commit 0621c66981
3 changed files with 66 additions and 49 deletions

View File

@ -154,6 +154,11 @@ jobs:
sleep 10 sleep 10
done done
- name: Run nixos-anywhere
if: inputs.action == 'create'
run: |
nix run github:nix-community/nixos-anywhere -- --flake github:nmasur/dotfiles#flame --target-host ubuntu@${{ steps.host.outputs.stdout }}
- name: Write Identity Keys to Files - name: Write Identity Keys to Files
if: inputs.action == 'create' if: inputs.action == 'create'
run: | run: |

View File

@ -23,52 +23,52 @@ provider "oci" {
region = "us-ashburn-1" region = "us-ashburn-1"
} }
# # Get the latest Ubuntu image OCID # Get the latest Ubuntu image OCID
# # We'll filter for a recent Ubuntu LTS version (e.g., 22.04 or 24.04) and pick the latest. # We'll filter for a recent Ubuntu LTS version (e.g., 22.04 or 24.04) and pick the latest.
# # Note: Image OCIDs are region-specific. This data source helps find the correct one. # Note: Image OCIDs are region-specific. This data source helps find the correct one.
# data "oci_core_images" "ubuntu_image" { data "oci_core_images" "ubuntu_image" {
# compartment_id = var.compartment_ocid
# operating_system = "Canonical Ubuntu"
# # Adjust this version if you prefer a different Ubuntu LTS (e.g., "24.04")
# operating_system_version = "24.04"
# shape_filter = var.instance_shape # Filter by the shape to ensure compatibility
# sort_by = "TIMECREATED"
# sort_order = "DESC"
# limit = 1 # Get only the latest
# }
resource "oci_core_image" "my_custom_image" {
compartment_id = var.compartment_ocid compartment_id = var.compartment_ocid
display_name = "noah-nixos" operating_system = "Canonical Ubuntu"
# Adjust this version if you prefer a different Ubuntu LTS (e.g., "24.04")
image_source_details { operating_system_version = "24.04"
source_type = "objectStorageTuple" # Use this if specifying namespace, bucket, and object name shape_filter = var.instance_shape # Filter by the shape to ensure compatibility
# source_type = "objectStorageUri" # Use this if you have a pre-authenticated request URL (PAR) sort_by = "TIMECREATED"
namespace_name = var.object_storage_namespace sort_order = "DESC"
bucket_name = var.object_storage_bucket_name limit = 1 # Get only the latest
object_name = var.object_storage_object_name
source_image_type = "QCOW2" # e.g., "QCOW2", "VMDK"
# These properties help OCI understand how to launch instances from this image
# Adjust based on your custom image's OS and boot mode
operating_system = "NixOS" # e.g., "CentOS", "Debian", "Windows"
operating_system_version = "25.05" # e.g., "7", "11", "2019"
} }
launch_mode = "PARAVIRTUALIZED" # Or "NATIVE", "EMULATED", "CUSTOM" # resource "oci_core_image" "my_custom_image" {
# Optional: for specific launch options if your image requires them # compartment_id = var.compartment_ocid
# launch_options { # display_name = "noah-nixos"
# boot_volume_type = "PARAVIRTUALIZED"
# firmware = "UEFI_64" # Or "BIOS" # image_source_details {
# network_type = "PARAVIRTUALIZED" # source_type = "objectStorageTuple" # Use this if specifying namespace, bucket, and object name
# # source_type = "objectStorageUri" # Use this if you have a pre-authenticated request URL (PAR)
# namespace_name = var.object_storage_namespace
# bucket_name = var.object_storage_bucket_name
# object_name = var.object_storage_object_name
# source_image_type = "QCOW2" # e.g., "QCOW2", "VMDK"
# # These properties help OCI understand how to launch instances from this image
# # Adjust based on your custom image's OS and boot mode
# operating_system = "NixOS" # e.g., "CentOS", "Debian", "Windows"
# operating_system_version = "25.05" # e.g., "7", "11", "2019"
# } # }
# Time out for image import operation. Can take a while for large images. # launch_mode = "PARAVIRTUALIZED" # Or "NATIVE", "EMULATED", "CUSTOM"
timeouts { # # Optional: for specific launch options if your image requires them
create = "60m" # Default is 20m, often needs to be increased # # launch_options {
} # # boot_volume_type = "PARAVIRTUALIZED"
} # # firmware = "UEFI_64" # Or "BIOS"
# # network_type = "PARAVIRTUALIZED"
# # }
# # Time out for image import operation. Can take a while for large images.
# timeouts {
# create = "60m" # Default is 20m, often needs to be increased
# }
# }
data "oci_identity_availability_domains" "ads" { data "oci_identity_availability_domains" "ads" {
compartment_id = var.compartment_ocid compartment_id = var.compartment_ocid
@ -82,10 +82,10 @@ resource "oci_core_instance" "my_compute_instance" {
source_details { source_details {
source_type = "image" source_type = "image"
# # Use the OCID of the latest Ubuntu image found by the data source # Use the OCID of the latest Ubuntu image found by the data source
# source_id = data.oci_core_images.ubuntu_image.images[0].id source_id = data.oci_core_images.ubuntu_image.images[0].id
# Use the OCID of the newly imported custom image # # Use the OCID of the newly imported custom image
source_id = oci_core_image.my_custom_image.id # source_id = oci_core_image.my_custom_image.id
# Specify the boot volume size # Specify the boot volume size
boot_volume_size_in_gbs = var.boot_volume_size_in_gbs boot_volume_size_in_gbs = var.boot_volume_size_in_gbs
} }

View File

@ -50,6 +50,18 @@ rec {
# fsType = "vfat"; # fsType = "vfat";
# }; # };
# This is the root filesystem containing NixOS
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
# This is the boot filesystem for Grub
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
# Allows private remote access over the internet # Allows private remote access over the internet
nmasur.presets.services.cloudflared = { nmasur.presets.services.cloudflared = {
tunnel = { tunnel = {