Public terraform

This commit is contained in:
Kat Inskip 2023-08-09 12:15:48 -07:00
parent 1ab58786d8
commit 79bcde13a9
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
8 changed files with 108 additions and 0 deletions

27
flake.lock generated
View file

@ -242,6 +242,32 @@
"type": "indirect"
}
},
"minecraft": {
"inputs": {
"flake-compat": [
"flake-compat"
],
"flake-utils": [
"utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1691544427,
"narHash": "sha256-OwVJ6hn/Yqye3sO1Z6CjdoQvVUMuielyr1Fn/Epqg7A=",
"owner": "Infinidoge",
"repo": "nix-minecraft",
"rev": "ab3c5557225d31e36bf447561133ef0850c7eb47",
"type": "github"
},
"original": {
"owner": "Infinidoge",
"repo": "nix-minecraft",
"type": "github"
}
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
@ -395,6 +421,7 @@
"home-manager": "home-manager",
"konawall-rs": "konawall-rs",
"mach-nix": "mach-nix",
"minecraft": "minecraft",
"nix-index-database": "nix-index-database",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2",

View file

@ -103,6 +103,14 @@
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
minecraft = {
url = "github:Infinidoge/nix-minecraft";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "utils";
flake-compat.follows = "flake-compat";
};
};
# a bunch of modules (also arcnmx is good)
arcexprs = {
url = "github:arcnmx/nixexprs/master";

View file

@ -0,0 +1,44 @@
{
pkgs,
inputs,
lib,
...
}: {
services.minecraft-servers = {
enable = true;
eula = true;
environmentFile = pkgs.writeText "aaaa" ''
QUILT_LOADER_DISABLE_BEACON=true
'';
servers.arkamew = let
modpack = inputs.minecraft.legacyPackages.${pkgs.system}.fetchPackwizModpack {
url = "https://github.com/kittywitch/arka-modpack/raw/main/pack.toml";
packHash = "sha256-5JbJvoVd+YxAS+EIFsXHuG5ZqVGxEgf2AjQOLSuG99U=";
manifestHash = "sha256:17lg9syx1ddggyq2h8a92frg4lpr2xc7ryh30bniv9dhymr0vc23";
side = "both";
};
mcVersion = modpack.manifest.versions.minecraft;
quiltVersion = modpack.manifest.versions.quilt;
serverVersion = lib.replaceStrings ["."] ["_"] "quilt-${mcVersion}-${quiltVersion}";
in {
enable = true;
autoStart = true;
openFirewall = true;
whitelist = {
katrynn = "356d8cf2-246a-4c07-b547-422aea06c0ab";
arcnmx = "e9244315-848c-424a-b004-ae5305449fee";
};
serverProperties = {
server-port = 25565;
gamemode = 0;
difficulty = 1;
white-list = true;
motd = "Kat & Abby Minecraft";
};
symlinks = {
mods = "${modpack}/mods";
};
package = inputs.minecraft.legacyPackages.${pkgs.system}.quiltServers.${serverVersion};
};
};
}

View file

@ -0,0 +1,16 @@
{config, ...}: {
services.nginx = {
virtualHosts = {
"public.gensokyo.zone" = {
enableACME = true;
forceSSL = true;
locations."/kat-is-a-cute-girl" = {
root = "/var/www/public";
extraConfig = ''
autoindex on;
'';
};
};
};
};
}

View file

@ -119,6 +119,7 @@ _: let
"pandoc"
];
casks = [
"temurin"
"barrier"
"bitwarden"
"mullvadvpn"
@ -129,6 +130,7 @@ _: let
"cyberduck"
"spotify"
"pycharm-ce"
"prismlauncher"
"element"
"slack"
"boop"

View file

@ -17,7 +17,9 @@ _: let
postgres-server
matrix-homeserver
vaultwarden-server
minecraft-server
monitoring-server
public-directory
irc-client
]);

8
tf/gensokyo-public.tf Normal file
View file

@ -0,0 +1,8 @@
resource "cloudflare_record" "public" {
name = "public"
proxied = true
ttl = 1
type = "CNAME"
value = "yukari.gensokyo.zone"
zone_id = local.zone_ids.gensokyo
}

View file

@ -61,6 +61,7 @@
[
nix-index-database.nixosModules.nix-index
home-manager.nixosModules.home-manager
minecraft.nixosModules.minecraft-servers
sops-nix.nixosModules.sops
]
++ (with (import (inputs.arcexprs + "/modules")).nixos; [