Compare commits

...

10 commits

Author SHA1 Message Date
Nick
1f43844e90 feat: got minecraft servers sorted 2025-11-27 01:17:38 -06:00
Nick
4c3ab7728c feat: added another minecraft world 2025-11-26 23:13:08 -06:00
Nick
301ba9c6e5 feat: added another minecraft world 2025-11-26 22:48:59 -06:00
Nick
6e0338dccb feat: added another minecraft world 2025-11-26 22:40:57 -06:00
Nick
710bc42aef feat: added another minecraft world 2025-11-26 22:34:04 -06:00
Nick
5b00235743 feat: added another minecraft world 2025-11-26 21:49:47 -06:00
Nick
6f4260e9e4 feat: added another minecraft world 2025-11-26 21:48:46 -06:00
Nick
a4e4f75265 feat: added another minecraft world 2025-11-26 21:40:17 -06:00
Nick
d92743dad4 feat: added proton client 2025-11-26 18:55:48 -06:00
Nick
fb113fd8c7 feat: testing protonVPN 2025-11-26 18:05:09 -06:00
13 changed files with 288 additions and 47 deletions

View file

@ -7,20 +7,18 @@ let
; ;
label = "Minecraft"; label = "Minecraft";
name = "minecraft"; name = "minecraft";
short = "mine"; world = "world0";
secrets = "${secretPath}/${name}";
in in
{ {
label = label; label = label;
name = name; name = name;
short = short;
ports = { ports = {
port0 = 43000; port0 = 43000;
}; };
interface = { interface = {
id = "vm-${short}"; id = "vm-${world}";
mac = "02:00:00:00:51:41"; mac = "02:00:00:00:51:41";
idUser = "vmuser-${short}"; idUser = "vmuser-${world}";
macUser = "02:00:00:00:00:41"; macUser = "02:00:00:00:00:41";
ip = "192.168.50.141"; ip = "192.168.50.141";
gate = "192.168.50.1"; gate = "192.168.50.1";
@ -30,9 +28,9 @@ in
path0 = "${varPath}/${name}"; path0 = "${varPath}/${name}";
}; };
mntPaths = { mntPaths = {
path0 = "${mntPath}/${name}"; path0 = "${mntPath}/${name}/${world}";
}; };
secretPaths = { secretPaths = {
path0 = secrets; path0 = "${secretPath}/${name}";
}; };
} }

View file

@ -0,0 +1,36 @@
{ moduleFunctions }:
let
inherit (moduleFunctions.instancesFunctions)
varPath
mntPath
secretPath
;
label = "Minecraft";
name = "minecraft";
world = "world1";
in
{
label = label;
name = name;
ports = {
port0 = 43001;
};
interface = {
id = "vm-${world}";
mac = "02:00:00:00:51:42";
idUser = "vmuser-${world}";
macUser = "02:00:00:00:00:42";
ip = "192.168.50.142";
gate = "192.168.50.1";
ssh = 2402;
};
varPaths = {
path0 = "${varPath}/${name}";
};
mntPaths = {
path0 = "${mntPath}/${name}/${world}";
};
secretPaths = {
path0 = "${secretPath}/${name}";
};
}

0
modules/home/cli/utilities/tshark/default.nix Normal file → Executable file
View file

View file

@ -57,6 +57,7 @@ in
opencloud opencloud
printManager printManager
prismLauncher prismLauncher
proton
puddleTag puddleTag
scrcpy scrcpy
sharing sharing
@ -103,6 +104,7 @@ in
okular okular
printManager printManager
prismLauncher prismLauncher
proton
scrcpy scrcpy
sharing sharing
signal signal

View file

@ -0,0 +1,11 @@
{
pkgs,
...
}:
{
home.packages = builtins.attrValues {
inherit (pkgs)
protonvpn-gui
;
};
}

View file

@ -7,5 +7,12 @@ let
map (name: ./. + "/${name}") dirContent; map (name: ./. + "/${name}") dirContent;
in in
{ {
systemd = {
tmpfiles.rules = [
"d /mnt/storage/minecraft 0751 microvm wheel - -"
];
};
imports = importList; imports = importList;
} }

View file

@ -5,7 +5,7 @@
let let
inherit (flake.config.people) user0; inherit (flake.config.people) user0;
inherit (flake.config.services) instances; inherit (flake.config.services) instances;
serviceCfg = instances.minecraft; serviceCfg = instances.minecraft0;
hostCfg = instances.web; hostCfg = instances.web;
world = "world0"; world = "world0";
in in
@ -154,15 +154,15 @@ in
tag = "read_only_nix_store"; tag = "read_only_nix_store";
} }
{ {
mountPoint = "/var/lib/${serviceCfg.name}"; mountPoint = serviceCfg.varPaths.path0;
proto = "virtiofs"; proto = "virtiofs";
source = serviceCfg.mntPaths.path0; source = serviceCfg.mntPaths.path0;
tag = "${serviceCfg.name}_data"; tag = "${serviceCfg.name}-${world}_data";
} }
{ {
mountPoint = "/run/secrets"; mountPoint = "/run/secrets";
proto = "virtiofs"; proto = "virtiofs";
source = "/run/secrets/${serviceCfg.name}"; source = serviceCfg.secretPaths.path0;
tag = "host_secrets"; tag = "host_secrets";
} }
]; ];
@ -171,12 +171,6 @@ in
}; };
}; };
systemd = {
tmpfiles.rules = [
"d ${serviceCfg.mntPaths.path0} 0751 microvm wheel - -"
];
};
sops.secrets = { sops.secrets = {
"${serviceCfg.name}/${world}" = { "${serviceCfg.name}/${world}" = {
owner = "root"; owner = "root";
@ -185,4 +179,11 @@ in
}; };
networking.firewall.allowedTCPPorts = [ serviceCfg.ports.port0 ]; networking.firewall.allowedTCPPorts = [ serviceCfg.ports.port0 ];
systemd = {
tmpfiles.rules = [
"d ${serviceCfg.mntPaths.path0} 0751 microvm wheel - -"
];
};
} }

View file

@ -0,0 +1,187 @@
{
flake,
...
}:
let
inherit (flake.config.people) user0;
inherit (flake.config.services) instances;
serviceCfg = instances.minecraft1;
hostCfg = instances.web;
world = "world1";
in
{
microvm.vms = {
"${serviceCfg.name}-${world}" = {
autostart = true;
restartIfChanged = true;
config = {
system.stateVersion = "24.05";
time.timeZone = "America/Winnipeg";
users.users.root.openssh.authorizedKeys.keys = flake.config.people.users.${user0}.sshKeys;
services = {
minecraft-server = {
enable = true;
eula = true;
openFirewall = true;
declarative = true;
serverProperties = {
"rcon.password" = "/etc/${serviceCfg.name}-secrets/${world}";
allow-flight = false;
allow-nether = true;
difficulty = 2;
enable-command-block = false;
enable-rcon = true;
enable-status = true;
force-gamemode = true;
gamemode = 0;
generate-structures = true;
hardcore = false;
hide-online-players = false;
level-name = "Cuddle Cubes";
level-seed = "-2332803749585407299";
max-players = 10;
max-world-size = 64000000;
motd = "A cool Minecraft server powered by NixOS";
online-mode = true;
pvp = true;
server-ip = hostCfg.localhost.address1;
server-port = serviceCfg.ports.port0;
spawn-animals = true;
spawn-monsters = true;
spawn-npcs = true;
spawn-protection = 16;
view-distance = 32;
white-list = true;
};
whitelist = {
Hefty_Chungus = "b75a9816-d408-4c54-b226-385b59ea1cb3";
Fallaryn = "d8baa117-ab58-4b07-92a5-48fb1978eb49";
};
};
openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "prohibit-password";
};
};
};
networking.firewall.allowedTCPPorts = [
22 # SSH
serviceCfg.ports.port0
];
systemd = {
services = {
"${serviceCfg.name}-copy-secrets" = {
description = "Copy secrets from virtiofs to local filesystem";
before = [ "minecraft-server.service" ];
requiredBy = [ "minecraft-server.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
script = ''
mkdir -p /etc/${serviceCfg.name}-secrets
cp /run/secrets/${world} /etc/${serviceCfg.name}-secrets/${world}
chmod 755 /etc/${serviceCfg.name}-secrets
chmod 644 /etc/${serviceCfg.name}-secrets/*
'';
};
};
network = {
enable = true;
networks."20-lan" = {
matchConfig.Name = "enp0s5";
addresses = [
{ Address = "${serviceCfg.interface.ip}/24"; }
];
routes = [
{
Destination = "${hostCfg.localhost.address1}/0";
Gateway = serviceCfg.interface.gate;
}
];
dns = [
"1.1.1.1"
"8.8.8.8"
];
};
};
tmpfiles.rules = [
"Z ${serviceCfg.varPaths.path0} 0755 ${serviceCfg.name} ${serviceCfg.name} -"
];
};
systemd.services.systemd-networkd.wantedBy = [ "multi-user.target" ];
microvm = {
vcpu = 2;
mem = 1024 * 3;
hypervisor = "qemu";
interfaces = [
{
type = "tap";
id = serviceCfg.interface.id;
mac = serviceCfg.interface.mac;
}
{
type = "user";
id = serviceCfg.interface.idUser;
mac = serviceCfg.interface.macUser;
}
];
forwardPorts = [
{
from = "host";
host.port = serviceCfg.interface.ssh;
guest.port = 22;
}
];
shares = [
{
mountPoint = "/nix/.ro-store";
proto = "virtiofs";
source = "/nix/store";
tag = "read_only_nix_store";
}
{
mountPoint = serviceCfg.varPaths.path0;
proto = "virtiofs";
source = serviceCfg.mntPaths.path0;
tag = "${serviceCfg.name}-${world}_data";
}
{
mountPoint = "/run/secrets";
proto = "virtiofs";
source = serviceCfg.secretPaths.path0;
tag = "host_secrets";
}
];
};
};
};
};
sops.secrets = {
"${serviceCfg.name}/${world}" = {
owner = "root";
mode = "0600";
};
};
networking.firewall.allowedTCPPorts = [ serviceCfg.ports.port0 ];
systemd = {
tmpfiles.rules = [
"d ${serviceCfg.mntPaths.path0} 0751 microvm wheel - -"
];
};
}

View file

@ -11,7 +11,7 @@ let
host = instances.torrent.domains.url0; host = instances.torrent.domains.url0;
dns0 = instances.web.dns.provider0; dns0 = instances.web.dns.provider0;
dns0Path = "dns/${dns0}"; dns0Path = "dns/${dns0}";
torrentPort = 2049; torrentPort = 51820;
in in
{ {
microvm.vms.${serviceCfg.name} = { microvm.vms.${serviceCfg.name} = {
@ -23,15 +23,14 @@ in
wg-quick.interfaces = { wg-quick.interfaces = {
wg0 = { wg0 = {
address = [ address = [
"172.22.116.126/32" "10.2.0.2/32"
"fd00:4956:504e:ffff::ac16:747e/128"
]; ];
dns = [ "172.16.0.1" ]; dns = [ "10.2.0.1" ];
privateKeyFile = "/run/secrets/wireguard-pass"; privateKeyFile = "/run/secrets/wireguard-pass";
peers = [ peers = [
{ {
publicKey = "hku9gjamhoii8OvxZgx+TdUDIkOAQYFu39qbav2AyUQ="; publicKey = "SFesR+3u5/vyQGeaCSREjs4m2WznwFlWAQ9CE3QSnRg=";
endpoint = "89.187.181.116:${builtins.toString torrentPort}"; endpoint = "104.254.95.98:${builtins.toString torrentPort}";
allowedIPs = [ allowedIPs = [
"0.0.0.0/0" "0.0.0.0/0"
"::/0" "::/0"
@ -78,6 +77,9 @@ in
MaxConnectionsPerTorrent = -1; MaxConnectionsPerTorrent = -1;
MaxUploads = -1; MaxUploads = -1;
MaxUploadsPerTorrent = -1; MaxUploadsPerTorrent = -1;
MaxActiveDownloads = -1;
MaxActiveUploads = -1;
MaxActiveTorrents = -1;
}; };
}; };

View file

@ -77,7 +77,4 @@ in
dnsProvider = instances.web.dns.provider0; dnsProvider = instances.web.dns.provider0;
environmentFile = config.sops.secrets."dns/${instances.web.dns.provider0}".path; environmentFile = config.sops.secrets."dns/${instances.web.dns.provider0}".path;
}; };
systemd.tmpfiles.rules = [
"d ${serviceCfg.mntPaths.path0} 0755 microvm wheel - -"
];
} }

View file

@ -106,12 +106,6 @@ in
}; };
}; };
systemd = {
tmpfiles.rules = [
"d ${serviceCfg.mntPaths.path0} 0751 microvm wheel - -"
];
};
sops.secrets = { sops.secrets = {
"${serviceCfg.name}/env" = { "${serviceCfg.name}/env" = {
owner = "root"; owner = "root";

View file

@ -23,17 +23,22 @@ in
OnCalendar = "0/4:00"; OnCalendar = "0/4:00";
Persistent = true; Persistent = true;
}; };
paths = [ paths =
let
instanceHelper = instance: instances.${instance}.mntPaths.path0;
in
[
"/home/${user0}/.ssh" "/home/${user0}/.ssh"
instances.firefly-iii.mntPaths.path0 (instanceHelper "firefly-iii")
instances.forgejo.mntPaths.path0 (instanceHelper "forgejo")
instances.mastodon.mntPaths.path0 (instanceHelper "mastodon")
instances.minecraft.mntPaths.path0 (instanceHelper "opencloud")
instances.opencloud.mntPaths.path0 (instanceHelper "minecraft0")
instances.vaultwarden.mntPaths.path0 (instanceHelper "minecraft1")
"${instances.jellyfin.mntPaths.path0}/cache" (instanceHelper "vaultwarden")
"${instances.jellyfin.mntPaths.path0}/data" ((instanceHelper "jellyfin") + "/cache")
"${instances.jellyfin.mntPaths.path0}/media/music" ((instanceHelper "jellyfin") + "/data")
((instanceHelper "jellyfin") + "/media/music")
]; ];
}; };
}; };

View file

@ -24,6 +24,7 @@ zookeeper:
env: ENC[AES256_GCM,data:CEEUmzRxvyeXSQfwUkmZq46HQNkv3I+wMzkBoUpAlh3D5O3L5kCeoDksDWuQrVTeQfIwKj18LDeeG+2Bz5XOVPTyXm/Ap+m2Jw==,iv:6eX7ocY5PiQaJ0KBDiKxhx0UguuQWcIbiZSYHY2hHjU=,tag:6vXg2fzRyfuJd5G3yNeUNA==,type:str] env: ENC[AES256_GCM,data:CEEUmzRxvyeXSQfwUkmZq46HQNkv3I+wMzkBoUpAlh3D5O3L5kCeoDksDWuQrVTeQfIwKj18LDeeG+2Bz5XOVPTyXm/Ap+m2Jw==,iv:6eX7ocY5PiQaJ0KBDiKxhx0UguuQWcIbiZSYHY2hHjU=,tag:6vXg2fzRyfuJd5G3yNeUNA==,type:str]
minecraft: minecraft:
world0: ENC[AES256_GCM,data:pz7P5g9jRL8KaARfSs2ddmN76ioKSuSv7A==,iv:ZFIhS15BPxHzTW4aPpT7A8R4rxuyNNGjPJXqJXYoBpk=,tag:aymiUs87YR519eZN8Aopyw==,type:str] world0: ENC[AES256_GCM,data:pz7P5g9jRL8KaARfSs2ddmN76ioKSuSv7A==,iv:ZFIhS15BPxHzTW4aPpT7A8R4rxuyNNGjPJXqJXYoBpk=,tag:aymiUs87YR519eZN8Aopyw==,type:str]
world1: ENC[AES256_GCM,data:vvMvvGlyrrufdoeiTWYUcKoYSyMtuOyQ2A2xPB0V81IM,iv:gQWuyxqcSTvrgKbhKlu8dZbBj0zqGImyB+W2ZufRyJc=,tag:ykPgGmRAEZl3M3HrEdE5Aw==,type:str]
vaultwarden: vaultwarden:
env: ENC[AES256_GCM,data:1MzIqnV/PCGNNqKVwhxZfmV92vRQsn3OxuvCXUtKyCmoA2xxD91U3EmMikTqM3EOHYAMHbF66YgQC5JjivbIF06OCeXMMLpGuN8ibCUQq7M6PQ34/LDMZnqynmC3/U0FJglSU7o1KA0=,iv:novSYG6j0l17xogdE5WiS2gNPNAVKeX9lgxe5EohBHk=,tag:w43z7a/MzObvVTQh8AiSTA==,type:str] env: ENC[AES256_GCM,data:1MzIqnV/PCGNNqKVwhxZfmV92vRQsn3OxuvCXUtKyCmoA2xxD91U3EmMikTqM3EOHYAMHbF66YgQC5JjivbIF06OCeXMMLpGuN8ibCUQq7M6PQ34/LDMZnqynmC3/U0FJglSU7o1KA0=,iv:novSYG6j0l17xogdE5WiS2gNPNAVKeX9lgxe5EohBHk=,tag:w43z7a/MzObvVTQh8AiSTA==,type:str]
dns: dns:
@ -55,7 +56,7 @@ firefly-iii:
data: ENC[AES256_GCM,data:921LhcRTWVk24eEAQoDMV+RllSP3PbSXCCIDXlQA80Mq,iv:YXEgas77DgdyPTnBZa/ySjcERBIwmdDZJbijeNKNF24=,tag:Wj25wA7tLJ2bZ/faG9DUhg==,type:str] data: ENC[AES256_GCM,data:921LhcRTWVk24eEAQoDMV+RllSP3PbSXCCIDXlQA80Mq,iv:YXEgas77DgdyPTnBZa/ySjcERBIwmdDZJbijeNKNF24=,tag:Wj25wA7tLJ2bZ/faG9DUhg==,type:str]
smtp: ENC[AES256_GCM,data:+e4MiRZ2WOZyWYpMf+By1Eb45ih4TA+svLI2+00yQk82,iv:+52+kJouMwkOSDEaOCA8V80+wT/VzNxgtCkOO68SCdk=,tag:YrtrJAXIhQpsUTEeYvrVwQ==,type:str] smtp: ENC[AES256_GCM,data:+e4MiRZ2WOZyWYpMf+By1Eb45ih4TA+svLI2+00yQk82,iv:+52+kJouMwkOSDEaOCA8V80+wT/VzNxgtCkOO68SCdk=,tag:YrtrJAXIhQpsUTEeYvrVwQ==,type:str]
proton: proton:
wireguard-pass: ENC[AES256_GCM,data:2SuLDMkJsOa/EjoYq0ZYp8A6yAO9KSaMJ35ofMXQDWhPcpL7/2eld83by021,iv:g5zGOdl2pGu3rsQcnwgRCHqDdzYNVkNhhfl3YMieBUY=,tag:FzbkDA4FyHrcC09EFZDoKw==,type:str] wireguard-pass: ENC[AES256_GCM,data:nHks/AYJGEuv8Dk2DWi01dFlaZtB1YWUc6BgJ+hu4BPS5aNK86mQRV31dIGV,iv:ht2W1OaqQ6pVrqqKxvzPml2ShPusNNI0LBjiagWmdo4=,tag:OSzqYqxsHaDy+xNl2j8axQ==,type:str]
backblaze: backblaze:
env: ENC[AES256_GCM,data:cdOYt77KocuGB3aqYz13oBokoLkEIgI1AW+cYC5uutgZYujG3PqoLEh6Gvbpzn3O+0OWg1/4UAYr4f2v7oCsgwFzPWS3HrhqC5+kIBjrPCyAnxDxlu2xaQ9hR+ogFh5UTDo=,iv:6+jx4Dj5CNV72DAss6NNYm44f9gSHco/EUBvL2o2CNI=,tag:6/cx84MgTDqQJxu/zINEeA==,type:str] env: ENC[AES256_GCM,data:cdOYt77KocuGB3aqYz13oBokoLkEIgI1AW+cYC5uutgZYujG3PqoLEh6Gvbpzn3O+0OWg1/4UAYr4f2v7oCsgwFzPWS3HrhqC5+kIBjrPCyAnxDxlu2xaQ9hR+ogFh5UTDo=,iv:6+jx4Dj5CNV72DAss6NNYm44f9gSHco/EUBvL2o2CNI=,tag:6/cx84MgTDqQJxu/zINEeA==,type:str]
repo: ENC[AES256_GCM,data:sRae9XELIfkWPaXelCdgEXIDbLTHVqGcRO0o+WA9aBfB8MUw92JjRCYgMgGXT0Apy38eszyuEHFB3XPpRmtQ7g==,iv:EilVA9zdHm6B9pTIhNxyj6Th1248nXvh0kpnEqZJ5HI=,tag:q9ASAgx5vgY0IePws4rT5Q==,type:str] repo: ENC[AES256_GCM,data:sRae9XELIfkWPaXelCdgEXIDbLTHVqGcRO0o+WA9aBfB8MUw92JjRCYgMgGXT0Apy38eszyuEHFB3XPpRmtQ7g==,iv:EilVA9zdHm6B9pTIhNxyj6Th1248nXvh0kpnEqZJ5HI=,tag:q9ASAgx5vgY0IePws4rT5Q==,type:str]
@ -72,7 +73,7 @@ sops:
bXBOa1VSakoyaWxpODJEOU11QUZCaUEK8Ch9Ten3DdrPHF1DTH2qei85AlHUOaLD bXBOa1VSakoyaWxpODJEOU11QUZCaUEK8Ch9Ten3DdrPHF1DTH2qei85AlHUOaLD
aNfzakake7ej+MxJYdKEU0bcWofNMKzIlZa2uM10KZSENDP8d8qlig== aNfzakake7ej+MxJYdKEU0bcWofNMKzIlZa2uM10KZSENDP8d8qlig==
-----END AGE ENCRYPTED FILE----- -----END AGE ENCRYPTED FILE-----
lastmodified: "2025-11-26T08:19:12Z" lastmodified: "2025-11-27T03:39:51Z"
mac: ENC[AES256_GCM,data:eqsiEBdTva+rjC64+n/RhVqWT7q4QUfARAvqZCezVCAvoTFJ+qJO2PWrJ39H/axLcLTwq7xC36UYkN8ckvAUSLx8pZyyuHVeI+4irL16AIpJM8z14kYG6dyw0ujVI+JZpM57FHWXkwX6JtzbqN7sv+u/YnM6ubfmporykvlQOmQ=,iv:eYhCL11iv3B6jsGieJ7nosKcd6MUH1QBWjJptgjBhiQ=,tag:7W+bhwOHM7e0zCP7eP0jxQ==,type:str] mac: ENC[AES256_GCM,data:EdxVM3/0cvMX5cumM+LDn5/qgOCMB6uySunlvEkPy3GHG3dHULc4MAw7bgI9DZ8Y0R26ipBzTKEoWWIIwCLcT+r6KwCM/HVg7gjuY+YbEnU71jivAKNg902Ue8LWNSKLvw1kAHkgtT/jPuMTuHShBTNTYeTsW5mGsqcXhdWVWC4=,iv:A3xeAtFwn4i7ijOA/vZ+XJ9jUeyt1FrvvKrGg5SeyAM=,tag:C7PuVjmYcjFB/u5Hi22aWg==,type:str]
unencrypted_suffix: _unencrypted unencrypted_suffix: _unencrypted
version: 3.11.0 version: 3.11.0