feat: hey it works, ish
This commit is contained in:
parent
322f0ec06b
commit
0ab1fb3fde
3 changed files with 43 additions and 11 deletions
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
@ -20,21 +20,53 @@ let
|
|||
fixupPhase = "";
|
||||
};
|
||||
instance = builtins.fromJSON (builtins.readFile "/etc/tjo.cloud/meta.json");
|
||||
|
||||
base_configuration = pkgs.fetchurl {
|
||||
url = "";
|
||||
sha256 = "";
|
||||
};
|
||||
in
|
||||
{
|
||||
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 = [
|
||||
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" ];
|
||||
system.autoUpgrade = {
|
||||
enable = true;
|
||||
dates = "06:00";
|
||||
randomizedDelaySec = "45min";
|
||||
};
|
||||
|
||||
# NETWORK
|
||||
networking.hostName = instance.name;
|
||||
|
|
|
@ -28,8 +28,8 @@ locals {
|
|||
k => merge(v, {
|
||||
public_ipv4 = local.ipv4_addresses[k]["ens18"][0]
|
||||
public_ipv6 = local.ipv6_addresses[k]["ens18"][0]
|
||||
internal_ipv4 = local.ipv4_addresses[k]["tailscale0"][0]
|
||||
internal_ipv6 = local.ipv6_addresses[k]["tailscale0"][0]
|
||||
internal_ipv4 = "" # local.ipv4_addresses[k]["tailscale0"][0]
|
||||
internal_ipv6 = "" # local.ipv6_addresses[k]["tailscale0"][0]
|
||||
#internal_ipv4 = data.tailscale_device.ingress[k].addresses[0]
|
||||
#internal_ipv6 = data.tailscale_device.ingress[k].addresses[1]
|
||||
})
|
||||
|
|
|
@ -6,7 +6,7 @@ variable "nodes" {
|
|||
bridge = string
|
||||
|
||||
cores = optional(number, 1)
|
||||
memory = optional(number, 1024)
|
||||
memory = optional(number, 3072)
|
||||
|
||||
storage = optional(string, "main")
|
||||
boot_size = optional(number, 8)
|
||||
|
|
Loading…
Reference in a new issue