init commit
This commit is contained in:
parent
cd78d5b172
commit
1a9746a773
7 changed files with 158 additions and 2 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
use flake
|
||||||
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -11,8 +11,8 @@ crash.log
|
||||||
crash.*.log
|
crash.*.log
|
||||||
|
|
||||||
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
|
# 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
|
# 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
|
# control as they are data points which are potentially sensitive and subject
|
||||||
# to change depending on the environment.
|
# to change depending on the environment.
|
||||||
*.tfvars
|
*.tfvars
|
||||||
*.tfvars.json
|
*.tfvars.json
|
||||||
|
|
@ -37,3 +37,5 @@ override.tf.json
|
||||||
.terraformrc
|
.terraformrc
|
||||||
terraform.rc
|
terraform.rc
|
||||||
|
|
||||||
|
# nix
|
||||||
|
.direnv
|
||||||
|
|
|
||||||
23
.terraform.lock.hcl
generated
Normal file
23
.terraform.lock.hcl
generated
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
# This file is maintained automatically by "tofu init".
|
||||||
|
# Manual edits may be lost in future updates.
|
||||||
|
|
||||||
|
provider "registry.opentofu.org/lxc/incus" {
|
||||||
|
version = "0.3.1"
|
||||||
|
constraints = "0.3.1"
|
||||||
|
hashes = [
|
||||||
|
"h1:OKdDao225lPcaL+Ib2hLLV8w8mWrx0BbEifMtFVwSJc=",
|
||||||
|
"zh:32b1c9dbd31e3ebf78994f19646feb10e304c3f40035de3d7c75afd08bfbd9d9",
|
||||||
|
"zh:39f74690d6c012f66fd14ffd2606e342c9ae693ff73e81c3d06a0867ffbbc8ab",
|
||||||
|
"zh:45cbe9cbfae44d9ef04d96ac717bf3e0b9493bf46da14c0c561f1518802ea040",
|
||||||
|
"zh:610d3da892aadfe5c03b1bb2cf76fea7645c8bde7a06543611cb165b56a73608",
|
||||||
|
"zh:6cef7658a5fd58bf0e88d8e5f335ca1f96aa96f9f77ea0b9fc17d314b204413a",
|
||||||
|
"zh:a26789474e406dc0e68a38cbb0defcbb832d7ffff659c29f6a5098c545ea9651",
|
||||||
|
"zh:b6beaffb4525b26a9deb64cff94fd248ab9b654a7e57610e36666823b499ea40",
|
||||||
|
"zh:d11fcee90dbe7a45d081a522b28adf7712c6bd41a96ca90b30195acdae973c2c",
|
||||||
|
"zh:dc992f89ae4cdb59a27d5867837bb725b24103b228e84714bbb8e900004377ef",
|
||||||
|
"zh:dcb731680196bad03101d2f9cd93911906b7c82ab182166ed437db7d6f97f590",
|
||||||
|
"zh:eb06fdccfa9f7842e3c40712fde6ffed0e39a3e2d46fe110dae071553f3324d1",
|
||||||
|
"zh:f10f0e4bd197ac35ced4d195eb78d22af9bb558082616e403fc009447417e34e",
|
||||||
|
"zh:fc330285c55cc5f3dbba306534adddc0e9922b1903932d34c2085412d41a38df",
|
||||||
|
]
|
||||||
|
}
|
||||||
40
flake.lock
generated
Normal file
40
flake.lock
generated
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-schemas": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1721999734,
|
||||||
|
"narHash": "sha256-G5CxYeJVm4lcEtaO87LKzOsVnWeTcHGKbKxNamNWgOw=",
|
||||||
|
"rev": "0a5c42297d870156d9c57d8f99e476b738dcd982",
|
||||||
|
"revCount": 75,
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.5/0190ef2f-61e0-794b-ba14-e82f225e55e6/source.tar.gz"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%2A"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1749494155,
|
||||||
|
"narHash": "sha256-FG4DEYBpROupu758beabUk9lhrblSf5hnv84v1TLqMc=",
|
||||||
|
"rev": "88331c17ba434359491e8d5889cce872464052c2",
|
||||||
|
"revCount": 803751,
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2505.803751%2Brev-88331c17ba434359491e8d5889cce872464052c2/01975aed-3cf2-75cb-ae5a-3b3ba077bb2e/source.tar.gz"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://flakehub.com/f/NixOS/nixpkgs/%2A"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-schemas": "flake-schemas",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
49
flake.nix
Normal file
49
flake.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
# This flake was initially generated by fh, the CLI for FlakeHub (version 0.1.22)
|
||||||
|
{
|
||||||
|
|
||||||
|
# Flake inputs
|
||||||
|
inputs = {
|
||||||
|
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*";
|
||||||
|
|
||||||
|
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Flake outputs that other flakes can use
|
||||||
|
outputs =
|
||||||
|
{
|
||||||
|
self,
|
||||||
|
flake-schemas,
|
||||||
|
nixpkgs,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
# Helpers for producing system-specific outputs
|
||||||
|
supportedSystems = [ "x86_64-linux" ];
|
||||||
|
forEachSupportedSystem =
|
||||||
|
f:
|
||||||
|
nixpkgs.lib.genAttrs supportedSystems (
|
||||||
|
system:
|
||||||
|
f {
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
}
|
||||||
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# Schemas tell Nix about the structure of your flake's outputs
|
||||||
|
schemas = flake-schemas.schemas;
|
||||||
|
|
||||||
|
# Development environments
|
||||||
|
devShells = forEachSupportedSystem (
|
||||||
|
{ pkgs }:
|
||||||
|
{
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
# Pinned packages available in the environment
|
||||||
|
packages = with pkgs; [
|
||||||
|
jq
|
||||||
|
opentofu
|
||||||
|
nixpkgs-fmt
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
||||||
18
main.tf
Normal file
18
main.tf
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
locals {
|
||||||
|
default_remote = "lappy"
|
||||||
|
instances = {
|
||||||
|
"tofu-example" = {
|
||||||
|
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "incus_instance" "demo" {
|
||||||
|
name = "demo"
|
||||||
|
image = "images:fedora/42"
|
||||||
|
config = {
|
||||||
|
"boot.autostart" = true
|
||||||
|
"limits.cpu" = 2
|
||||||
|
"limits.memory" = "4GiB"
|
||||||
|
}
|
||||||
|
}
|
||||||
23
providers.tf
Normal file
23
providers.tf
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
incus = {
|
||||||
|
source = "lxc/incus"
|
||||||
|
version = "0.3.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
provider "incus" {
|
||||||
|
generate_client_certificates = true
|
||||||
|
accept_remote_certificate = true
|
||||||
|
|
||||||
|
remote {
|
||||||
|
default = true
|
||||||
|
name = "lappy"
|
||||||
|
scheme = "https"
|
||||||
|
address = "olympus.tailfc9f5.ts.net"
|
||||||
|
token = "token"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Reference in a new issue