feat: hey it works, ish

This commit is contained in:
Tine 2024-09-01 11:24:32 +02:00
parent 322f0ec06b
commit 0ab1fb3fde
Signed by: mentos1386
SSH key fingerprint: SHA256:MNtTsLbihYaWF8j1fkOHfkKNlnN1JQfxEU/rBU8nCGw
3 changed files with 43 additions and 11 deletions

View file

@ -1,8 +1,8 @@
{ {
inputs,
lib, lib,
config, config,
pkgs, pkgs,
modulesPath,
... ...
}: }:
let let
@ -20,21 +20,53 @@ let
fixupPhase = ""; fixupPhase = "";
}; };
instance = builtins.fromJSON (builtins.readFile "/etc/tjo.cloud/meta.json"); instance = builtins.fromJSON (builtins.readFile "/etc/tjo.cloud/meta.json");
base_configuration = pkgs.fetchurl {
url = "";
sha256 = "";
};
in in
{ {
system.stateVersion = "24.05"; 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 = [ 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" ]; nix.nixPath = [ "nixos-config=/etc/tjo.cloud/configuration.nix" ];
system.autoUpgrade = {
enable = true;
dates = "06:00";
randomizedDelaySec = "45min";
};
# NETWORK # NETWORK
networking.hostName = instance.name; networking.hostName = instance.name;

View file

@ -28,8 +28,8 @@ locals {
k => merge(v, { k => merge(v, {
public_ipv4 = local.ipv4_addresses[k]["ens18"][0] public_ipv4 = local.ipv4_addresses[k]["ens18"][0]
public_ipv6 = local.ipv6_addresses[k]["ens18"][0] public_ipv6 = local.ipv6_addresses[k]["ens18"][0]
internal_ipv4 = local.ipv4_addresses[k]["tailscale0"][0] internal_ipv4 = "" # local.ipv4_addresses[k]["tailscale0"][0]
internal_ipv6 = local.ipv6_addresses[k]["tailscale0"][0] internal_ipv6 = "" # local.ipv6_addresses[k]["tailscale0"][0]
#internal_ipv4 = data.tailscale_device.ingress[k].addresses[0] #internal_ipv4 = data.tailscale_device.ingress[k].addresses[0]
#internal_ipv6 = data.tailscale_device.ingress[k].addresses[1] #internal_ipv6 = data.tailscale_device.ingress[k].addresses[1]
}) })

View file

@ -6,7 +6,7 @@ variable "nodes" {
bridge = string bridge = string
cores = optional(number, 1) cores = optional(number, 1)
memory = optional(number, 1024) memory = optional(number, 3072)
storage = optional(string, "main") storage = optional(string, "main")
boot_size = optional(number, 8) boot_size = optional(number, 8)