Compare commits
No commits in common. "62334a00dd0b83d86e2838beecce4ac7412c1eef" and "ae00442324618b91440066e3a54a5e2b06e6de84" have entirely different histories.
62334a00dd
...
ae00442324
13 changed files with 0 additions and 355 deletions
14
flake.nix
14
flake.nix
|
|
@ -135,20 +135,6 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
busch-main-docker = nixpkgs.lib.nixosSystem rec {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
|
|
||||||
specialArgs = {
|
|
||||||
inherit inputs outputs;
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
./hosts/busch-main-docker
|
|
||||||
disko.nixosModules.disko
|
|
||||||
agenix.nixosModules.default
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
srv01-hf = nixpkgs.lib.nixosSystem rec {
|
srv01-hf = nixpkgs.lib.nixosSystem rec {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
{ inputs, outputs, config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[
|
|
||||||
../../modules/disko/legacy-full-ext4.nix
|
|
||||||
|
|
||||||
../../users/julius/nixos-server.nix
|
|
||||||
../../modules/nix.nix
|
|
||||||
../../modules/auto-upgrade.nix
|
|
||||||
../../modules/locale.nix
|
|
||||||
../../modules/server-cli.nix
|
|
||||||
../../modules/sshd.nix
|
|
||||||
../../modules/docker.nix
|
|
||||||
"${inputs.secrets}/modules/opkssh.nix"
|
|
||||||
|
|
||||||
# Include the results of the hardware scan.
|
|
||||||
./hardware-configuration.nix
|
|
||||||
];
|
|
||||||
# Use the GRUB 2 boot loader.
|
|
||||||
boot = {
|
|
||||||
loader.grub = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
tmp.useTmpfs = true;
|
|
||||||
};
|
|
||||||
networking.hostName = "docker-main"; # Define your hostname.
|
|
||||||
|
|
||||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
|
||||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
|
||||||
# Most users should NEVER change this value after the initial install, for any reason,
|
|
||||||
# even if you've upgraded your system to a new NixOS release.
|
|
||||||
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
|
||||||
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
|
||||||
# to actually do that.
|
|
||||||
# This value being lower than the current NixOS release does NOT mean your system is
|
|
||||||
# out of date, out of support, or vulnerable.
|
|
||||||
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
|
||||||
# and migrated your data accordingly.
|
|
||||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
|
||||||
system.stateVersion = "25.05"; # Did you read the comment?
|
|
||||||
}
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
|
||||||
# and may be overwritten by future invocations. Please make changes
|
|
||||||
# to /etc/nixos/configuration.nix instead.
|
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
}
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
../../modules/newt.nix
|
../../modules/newt.nix
|
||||||
../../modules/dockhand.nix
|
../../modules/dockhand.nix
|
||||||
../../modules/auto-upgrade.nix
|
../../modules/auto-upgrade.nix
|
||||||
"${inputs.secrets}/modules/opkssh.nix"
|
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
{
|
|
||||||
disko.devices = {
|
|
||||||
disk = {
|
|
||||||
sda = {
|
|
||||||
type = "disk";
|
|
||||||
device = "/dev/sda";
|
|
||||||
content = {
|
|
||||||
type = "gpt";
|
|
||||||
partitions = {
|
|
||||||
MBR = {
|
|
||||||
type = "EF02"; # for grub MBR
|
|
||||||
size = "1M";
|
|
||||||
priority = 1; # Needs to be first partition
|
|
||||||
};
|
|
||||||
root = {
|
|
||||||
size = "100%";
|
|
||||||
content = {
|
|
||||||
type = "filesystem";
|
|
||||||
format = "ext4";
|
|
||||||
mountpoint = "/";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
use flake ../#opentofu
|
|
||||||
42
terraform/.gitignore
vendored
42
terraform/.gitignore
vendored
|
|
@ -1,42 +0,0 @@
|
||||||
# Local .terraform directories
|
|
||||||
**/.terraform/*
|
|
||||||
|
|
||||||
# .tfstate files
|
|
||||||
*.tfstate
|
|
||||||
*.tfstate.*
|
|
||||||
|
|
||||||
# Crash log files
|
|
||||||
crash.log
|
|
||||||
crash.*.log
|
|
||||||
|
|
||||||
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
|
|
||||||
# password, private keys, and other secrets. These should not be part of version
|
|
||||||
# control as they are data points which are potentially sensitive and subject
|
|
||||||
# to change depending on the environment.
|
|
||||||
*.tfvars
|
|
||||||
*.tfvars.json
|
|
||||||
|
|
||||||
# Ignore override files as they are usually used to override resources locally and so
|
|
||||||
# are not checked in
|
|
||||||
override.tf
|
|
||||||
override.tofu
|
|
||||||
override.tf.json
|
|
||||||
override.tofu.json
|
|
||||||
*_override.tf
|
|
||||||
*_override.tofu
|
|
||||||
*_override.tf.json
|
|
||||||
*_override.tofu.json
|
|
||||||
|
|
||||||
# Ignore transient lock info files created by tofu apply
|
|
||||||
.terraform.tfstate.lock.info
|
|
||||||
|
|
||||||
# Include override files you do wish to add to version control using negated pattern
|
|
||||||
# !example_override.tf
|
|
||||||
# !example_override.tofu
|
|
||||||
|
|
||||||
# Include tfplan files to ignore the plan output of command: tofu plan -out=tfplan
|
|
||||||
# example: *tfplan*
|
|
||||||
|
|
||||||
# Ignore CLI configuration files
|
|
||||||
.terraformrc
|
|
||||||
terraform.rc
|
|
||||||
24
terraform/busch/.terraform.lock.hcl
generated
24
terraform/busch/.terraform.lock.hcl
generated
|
|
@ -1,24 +0,0 @@
|
||||||
# This file is maintained automatically by "tofu init".
|
|
||||||
# Manual edits may be lost in future updates.
|
|
||||||
|
|
||||||
provider "registry.opentofu.org/telmate/proxmox" {
|
|
||||||
version = "3.0.2-rc07"
|
|
||||||
constraints = "3.0.2-rc07"
|
|
||||||
hashes = [
|
|
||||||
"h1:zp5hpQJQ4t4zROSLqdltVpBO+Riy9VugtfFbpyTw1aM=",
|
|
||||||
"zh:2ee860cd0a368b3eaa53f4a9ea46f16dab8a97929e813ea6ef55183f8112c2ca",
|
|
||||||
"zh:415965fd915bae2040d7f79e45f64d6e3ae61149c10114efeac1b34687d7296c",
|
|
||||||
"zh:6584b2055df0e32062561c615e3b6b2c291ca8c959440adda09ef3ec1e1436bd",
|
|
||||||
"zh:65dcfad71928e0a8dd9befc22524ed686be5020b0024dc5cca5184c7420eeb6b",
|
|
||||||
"zh:7253dc29bd265d33f2791ac4f779c5413f16720bb717de8e6c5fcb2c858648ea",
|
|
||||||
"zh:7ec8993da10a47606670f9f67cfd10719a7580641d11c7aa761121c4a2bd66fb",
|
|
||||||
"zh:999a3f7a9dcf517967fc537e6ec930a8172203642fb01b8e1f78f908373db210",
|
|
||||||
"zh:a50e6df7280eb6584a5fd2456e3f5b6df13b2ec8a7fa4605511e438e1863be42",
|
|
||||||
"zh:b25b329a1e42681c509d027fee0365414f0cc5062b65690cfc3386aab16132ae",
|
|
||||||
"zh:c028877fdb438ece48f7bc02b65bbae9ca7b7befbd260e519ccab6c0cbb39f26",
|
|
||||||
"zh:cf0eaa3ea9fcc6d62793637947f1b8d7c885b6ad74695ab47e134e4ff132190f",
|
|
||||||
"zh:d5ade3fae031cc629b7c512a7b60e46570f4c41665e88a595d7efd943dde5ab2",
|
|
||||||
"zh:f388c15ad1ecfc09e7361e3b98bae9b627a3a85f7b908c9f40650969c949901c",
|
|
||||||
"zh:f415cc6f735a3971faae6ac24034afdb9ee83373ef8de19a9631c187d5adc7db",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
terraform {
|
|
||||||
required_providers {
|
|
||||||
proxmox = {
|
|
||||||
source = "telmate/proxmox"
|
|
||||||
version = "3.0.2-rc07"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
provider "proxmox" {
|
|
||||||
pm_api_url = var.proxmox_api_url
|
|
||||||
pm_api_token_id = var.proxmox_token_id
|
|
||||||
pm_api_token_secret = var.proxmox_token_secret
|
|
||||||
pm_tls_insecure = true
|
|
||||||
}
|
|
||||||
|
|
||||||
module "truenas" {
|
|
||||||
source = "./modules/proxmox-vm"
|
|
||||||
|
|
||||||
name = "truenas"
|
|
||||||
target_node = "busch"
|
|
||||||
vmid = 100
|
|
||||||
memory = 8192
|
|
||||||
cpu_cores = 2
|
|
||||||
disk_storage = "local"
|
|
||||||
disk_size = "32G"
|
|
||||||
iso_path = "local:iso/TrueNAS-SCALE-25.10.2.1.iso"
|
|
||||||
startup_order = 1
|
|
||||||
|
|
||||||
mapped_pcie_devices = ["HBA"]
|
|
||||||
}
|
|
||||||
|
|
||||||
module "nixos-docker" {
|
|
||||||
source = "./modules/proxmox-vm"
|
|
||||||
|
|
||||||
name = "nixos-docker"
|
|
||||||
target_node = "busch"
|
|
||||||
vmid = 101
|
|
||||||
memory = 4096
|
|
||||||
cpu_cores = 2
|
|
||||||
disk_storage = "truenas-lvm"
|
|
||||||
disk_size = "64G"
|
|
||||||
iso_path = "local:iso/latest-nixos-minimal-x86_64-linux.iso"
|
|
||||||
startup_order = 2
|
|
||||||
startup_delay = 240
|
|
||||||
}
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
terraform {
|
|
||||||
required_providers {
|
|
||||||
proxmox = {
|
|
||||||
source = "telmate/proxmox"
|
|
||||||
version = "3.0.2-rc07"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "proxmox_vm_qemu" "truenas" {
|
|
||||||
name = var.name
|
|
||||||
description = var.description
|
|
||||||
target_node = var.target_node
|
|
||||||
vmid = var.vmid
|
|
||||||
machine = length(var.mapped_pcie_devices) == 0 ? "pc" : "q35"
|
|
||||||
memory = var.memory
|
|
||||||
balloon = 1024
|
|
||||||
scsihw = "virtio-scsi-pci"
|
|
||||||
boot = "order=scsi0;ide0"
|
|
||||||
start_at_node_boot = true
|
|
||||||
|
|
||||||
cpu {
|
|
||||||
cores = var.cpu_cores
|
|
||||||
sockets = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
disks {
|
|
||||||
scsi {
|
|
||||||
scsi0 {
|
|
||||||
disk {
|
|
||||||
storage = var.disk_storage
|
|
||||||
size = var.disk_size
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ide {
|
|
||||||
ide0 {
|
|
||||||
cdrom {
|
|
||||||
iso = var.iso_path
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
network {
|
|
||||||
id = 0
|
|
||||||
bridge = "vmbr0"
|
|
||||||
model = "virtio"
|
|
||||||
}
|
|
||||||
|
|
||||||
dynamic "pci" {
|
|
||||||
for_each = { for device in var.mapped_pcie_devices : index(var.mapped_pcie_devices, device) => device }
|
|
||||||
|
|
||||||
content {
|
|
||||||
id = pci.key
|
|
||||||
mapping_id = pci.value
|
|
||||||
pcie = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
startup_shutdown {
|
|
||||||
order = var.startup_order
|
|
||||||
startup_delay = var.startup_delay
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
variable "vmid" {
|
|
||||||
description = "ID of the VM to create"
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "name" {
|
|
||||||
description = "Name of the VM to create"
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "description" {
|
|
||||||
description = "Description of the VM to create"
|
|
||||||
type = string
|
|
||||||
default = null
|
|
||||||
nullable = true
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "target_node" {
|
|
||||||
description = "Name of the target node to create the VM on"
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "memory" {
|
|
||||||
description = "Memory to allocate for the VM"
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "cpu_cores" {
|
|
||||||
description = "Number of CPU cores to allocate for the VM"
|
|
||||||
type = number
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "disk_storage" {
|
|
||||||
description = "Name of the storage to store the disk on"
|
|
||||||
type = string
|
|
||||||
default = "local"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "disk_size" {
|
|
||||||
description = "Size of the primary disk"
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "iso_path" {
|
|
||||||
description = "Path of the ISO to use to install an OS"
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "startup_order" {
|
|
||||||
description = "Order number of the VM in the startup chain"
|
|
||||||
type = number
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "startup_delay" {
|
|
||||||
description = "Startup delay in seconds"
|
|
||||||
type = number
|
|
||||||
default = -1
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "mapped_pcie_devices" {
|
|
||||||
description = "PCI mappings"
|
|
||||||
type = list(string)
|
|
||||||
default = []
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
|
@ -1,10 +0,0 @@
|
||||||
variable "proxmox_api_url" {
|
|
||||||
description = "API URL, typically ends with `/api2/json`"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "proxmox_token_id" {
|
|
||||||
description = "Token ID"
|
|
||||||
}
|
|
||||||
variable "proxmox_token_secret" {
|
|
||||||
description = "Token Secret"
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue