feat: terraria server && nextcloud raw camera format support

This commit is contained in:
DACHXY 2025-07-14 19:37:16 +08:00
parent fb06f7eee0
commit ac770b6531
11 changed files with 186 additions and 53 deletions

49
flake.lock generated
View file

@ -978,6 +978,24 @@
"type": "github" "type": "github"
} }
}, },
"nix-tmodloader": {
"inputs": {
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1734377184,
"narHash": "sha256-1Nz10m5qTsSXedAAl08cN/ama6lCDsM/WgdV5lb/9cQ=",
"owner": "andOrlando",
"repo": "nix-tmodloader",
"rev": "e29ca685ed7e59ef67c592030932ef17dbd8539c",
"type": "github"
},
"original": {
"owner": "andOrlando",
"repo": "nix-tmodloader",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1746461020, "lastModified": 1746461020,
@ -1091,8 +1109,24 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1746663147, "lastModified": 1749285348,
"narHash": "sha256-Ua0drDHawlzNqJnclTJGf87dBmaO/tn7iZ+TCkTRpRc=", "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3e3afe5174c561dee0df6f2c2b2236990146329f",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1746461020,
"narHash": "sha256-7+pG1I9jvxNlmln4YgnlW4o+w0TZX24k688mibiFDUE=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "dda3dcd3fe03e991015e9a74b22d35950f264a54", "rev": "dda3dcd3fe03e991015e9a74b22d35950f264a54",
@ -1105,7 +1139,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_5": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1744868846, "lastModified": 1744868846,
"narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=", "narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=",
@ -1121,7 +1155,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_6": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1744868846, "lastModified": 1744868846,
"narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=", "narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=",
@ -1202,7 +1236,8 @@
"neovim-nightly-overlay": "neovim-nightly-overlay", "neovim-nightly-overlay": "neovim-nightly-overlay",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nix-minecraft": "nix-minecraft", "nix-minecraft": "nix-minecraft",
"nixpkgs": "nixpkgs_4", "nix-tmodloader": "nix-tmodloader",
"nixpkgs": "nixpkgs_5",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"yazi": "yazi" "yazi": "yazi"
} }
@ -1251,7 +1286,7 @@
}, },
"sops-nix": { "sops-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_5" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1746485181, "lastModified": 1746485181,
@ -1437,7 +1472,7 @@
"yazi": { "yazi": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_6", "nixpkgs": "nixpkgs_7",
"rust-overlay": "rust-overlay_2" "rust-overlay": "rust-overlay_2"
}, },
"locked": { "locked": {

View file

@ -69,6 +69,10 @@
url = "github:Infinidoge/nix-minecraft"; url = "github:Infinidoge/nix-minecraft";
}; };
nix-tmodloader = {
url = "github:andOrlando/nix-tmodloader";
};
sops-nix = { sops-nix = {
url = "github:Mic92/sops-nix"; url = "github:Mic92/sops-nix";
}; };
@ -206,10 +210,12 @@
}; };
extra-modules = [ extra-modules = [
inputs.nix-minecraft.nixosModules.minecraft-servers inputs.nix-minecraft.nixosModules.minecraft-servers
inputs.nix-tmodloader.nixosModules.tmodloader
./system/dev/dn-server ./system/dev/dn-server
]; ];
overlays = [ overlays = [
inputs.nix-minecraft.overlay inputs.nix-minecraft.overlay
inputs.nix-tmodloader.overlay
]; ];
}; };
}; };

View file

@ -4,32 +4,14 @@
EDITOR = "nvim"; EDITOR = "nvim";
TERMINAL = "ghostty"; TERMINAL = "ghostty";
ELECTRON_OZONE_PLATFORM_HINT = "auto"; ELECTRON_OZONE_PLATFORM_HINT = "auto";
GDK_BACKEND = "wayland";
COLORTERM = "truecolor"; COLORTERM = "truecolor";
NIXOS_OZONE_WL = "1";
NIXOS_XDG_OPEN_USE_PORTAL = "1";
QT_SCALE_FACTOR = "1";
QT_QPA_PLATFORM = "wayland-egl";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
QT_IM_MODULES = "wayland;fcitx;ibus";
MOZ_ENABLE_WAYLAND = "1";
SDL_VIDEODRIVER = "wayland,x11";
WLR_NO_HARDWARE_CURSORS = "1";
CLUTTER_BACKEND = "wayland";
EGL_PLATFORM = "wayland";
WLR_RENDERER = "vulkan";
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
XDG_CACHE_HOME = "\${HOME}/.cache"; XDG_CACHE_HOME = "\${HOME}/.cache";
XDG_CONFIG_HOME = "\${HOME}/.config"; XDG_CONFIG_HOME = "\${HOME}/.config";
XDG_DATA_HOME = "\${HOME}/.local/share"; XDG_DATA_HOME = "\${HOME}/.local/share";
XDG_DATA_DIRS = "\${XDG_DATA_DIRS}:/usr/share:/var/lib/flatpak/exports/share:\${HOME}/.local/share/flatpak/exports/share"; XDG_DATA_DIRS = "\${XDG_DATA_DIRS}:/usr/share:/var/lib/flatpak/exports/share:\${HOME}/.local/share/flatpak/exports/share";
WLR_RENDERER = "vulkan";
GTK_CSD = "0"; GTK_CSD = "0";
GTK_USE_PORTAL = "1"; GTK_USE_PORTAL = "1";
GTK_IM_MODULE = ""; GTK_IM_MODULE = "";

View file

@ -568,4 +568,25 @@ in
(rofi-calc.override { rofi-unwrapped = rofi-wayland-unwrapped; }) (rofi-calc.override { rofi-unwrapped = rofi-wayland-unwrapped; })
]; ];
}; };
home.sessionVariables = {
NIXOS_OZONE_WL = "1";
NIXOS_XDG_OPEN_USE_PORTAL = "1";
GDK_BACKEND = "wayland";
QT_SCALE_FACTOR = "1";
QT_QPA_PLATFORM = "wayland-egl";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
QT_IM_MODULES = "wayland;fcitx;ibus";
MOZ_ENABLE_WAYLAND = "1";
SDL_VIDEODRIVER = "wayland";
WLR_NO_HARDWARE_CURSORS = "1";
CLUTTER_BACKEND = "wayland";
EGL_PLATFORM = "wayland";
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
};
} }

View file

@ -32,6 +32,7 @@
domain = "https://bitwarden.net.dn"; domain = "https://bitwarden.net.dn";
}) })
(import ../../modules/openldap.nix { }) (import ../../modules/openldap.nix { })
../../modules/terraria.nix
]; ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [

View file

@ -23,6 +23,10 @@ let
port = 443; port = 443;
ssl = true; ssl = true;
} }
{
addr = "0.0.0.0";
port = 80;
}
]; ];
} }
else else
@ -77,11 +81,6 @@ let
chown nginx:nginx -R /etc/letsencrypt chown nginx:nginx -R /etc/letsencrypt
''; '';
pre7780 = {
hostname = "pre-nextcloud.net.dn";
ip = "10.0.0.130";
};
vaultwarden = { vaultwarden = {
domain = "bitwarden.net.dn"; domain = "bitwarden.net.dn";
}; };
@ -128,10 +127,30 @@ in
''; '';
}; };
${pre7780.hostname} = mkProxyHost { "files.net.dn" = {
domain = pre7780.hostname; listen = [
proxyPass = "http://${pre7780.ip}"; {
ssl = true; addr = "0.0.0.0";
port = 80;
}
];
root = "/var/www/files";
locations."/" = {
extraConfig = ''
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
'';
};
extraConfig = ''
types {
image/png png;
image/jpeg jpg jpeg;
image/gif gif;
}
'';
}; };
${vaultwarden.domain} = mkProxyHost { ${vaultwarden.domain} = mkProxyHost {

View file

@ -97,6 +97,11 @@ let
publicKey = "GAayY6p8ST3I66kFSGY3seaHhfkrc6atcrFu2C9BDDs="; publicKey = "GAayY6p8ST3I66kFSGY3seaHhfkrc6atcrFu2C9BDDs=";
allowedIPs = [ "10.0.0.5/32" ]; allowedIPs = [ "10.0.0.5/32" ];
} }
{
dns = "jonly-mac";
publicKey = "jPmeA0WH3vQw/PDNdJwYLfE7Ibl5oZGuta9UkZNEyTk=";
allowedIPs = [ "10.0.0.9/32" ];
}
{ {
# YC # YC
dns = "yc"; dns = "yc";
@ -385,13 +390,14 @@ in
@ IN MX 10 mail.${origin} @ IN MX 10 mail.${origin}
IN TXT "v=spf1 mx" IN TXT "v=spf1 mx"
dns IN A ${serverIP} dns IN A ${serverIP}
files IN A ${serverIP}
nextcloud IN A ${serverIP} nextcloud IN A ${serverIP}
bitwarden IN A ${serverIP} bitwarden IN A ${serverIP}
pre-nextcloud IN A ${serverIP}
ca IN A ${serverIP} ca IN A ${serverIP}
${hostname} IN A ${serverIP} ${hostname} IN A ${serverIP}
mail IN A ${serverIP} mail IN A ${serverIP}
api-kube IN A ${kubeIP} api-kube IN A ${kubeIP}
vmail IN A 10.0.0.130
${dnsRecords} ${dnsRecords}
''; '';
}; };
@ -423,9 +429,10 @@ in
${serverIP} IN PTR mail.${personal.domain}. ${serverIP} IN PTR mail.${personal.domain}.
${serverIP} IN PTR ${hostname}.${personal.domain}. ${serverIP} IN PTR ${hostname}.${personal.domain}.
${serverIP} IN PTR nextcloud.${personal.domain}. ${serverIP} IN PTR nextcloud.${personal.domain}.
${serverIP} IN PTR files.${personal.domain}.
${serverIP} IN PTR bitwarden.${personal.domain}. ${serverIP} IN PTR bitwarden.${personal.domain}.
${serverIP} IN PTR pre-nextcloud.${personal.domain}.
${serverIP} IN PTR ca.${personal.domain}. ${serverIP} IN PTR ca.${personal.domain}.
130 IN PTR vmail.${personal.domain}.
${dnsReversedRecords} ${dnsReversedRecords}
''; '';

View file

@ -15,6 +15,8 @@
}; };
}; };
programs.gamescope.enable = lib.mkDefault true;
programs = { programs = {
steam = { steam = {
enable = true; enable = true;

15
system/modules/gnome.nix Normal file
View file

@ -0,0 +1,15 @@
{
lib,
...
}:
{
environment.sessionVariables = {
XDG_CURRENT_DESKTOP = "GNOME";
};
services.xserver = {
enable = lib.mkDefault true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
};
}

View file

@ -59,21 +59,11 @@
tasks tasks
; ;
passwords = camerarawpreviews = pkgs.fetchNextcloudApp {
(pkgs.fetchNextcloudApp { url = "https://github.com/ariselseng/camerarawpreviews/releases/download/v0.8.7/camerarawpreviews_nextcloud.tar.gz";
sha256 = "sha256-Nu6WViFawQWby9CEEezAwoBNdp7O5O8a9IhDp/me/E0="; sha256 = "sha256-aiMUSJQVbr3xlJkqOaE3cNhdZu3CnPEIWTNVOoG4HSo=";
url = "https://git.mdns.eu/api/v4/projects/45/packages/generic/passwords/2025.2.0/passwords.tar.gz"; license = "agpl3Plus";
license = "agpl3Plus"; };
}).overrideAttrs
(prev: {
unpackPhase = ''
cp $src passwords.tar.gz
tar -xf passwords.tar.gz
mv passwords/* ./
rm passwords.tar.gz
rm -r passwords
'';
});
}; };
extraAppsEnable = true; extraAppsEnable = true;
@ -97,6 +87,10 @@
"OC\\Preview\\TXT" "OC\\Preview\\TXT"
"OC\\Preview\\XBitmap" "OC\\Preview\\XBitmap"
"OC\\Preview\\HEIC" "OC\\Preview\\HEIC"
"OC\\Preview\\SVG"
"OC\\Preview\\FONT"
"OC\\Preview\\Imaginary"
"OC\\Preview\\ImaginaryPDF"
]; ];
}; };
}; };

View file

@ -0,0 +1,51 @@
{ pkgs, ... }:
let
serverPkg = pkgs.tmodloader-server.overrideAttrs (
final: prev: rec {
version = "v2025.04.3.0";
name = "tmodloader-${version}";
url = "https://github.com/tModLoader/tModLoader/releases/download/${version}/tModLoader.zip";
src = pkgs.fetchurl {
inherit url;
hash = "sha256-cu98vb3T2iGC9W3e3nfls3mYTUQ4sviRHyViL0Qexn0=";
};
}
);
in
{
services.tmodloader = {
enable = true;
servers.pokemon = {
enable = true;
openFirewall = true;
port = 7777;
autoStart = true;
package = serverPkg;
world = "/var/lib/tmodloader/pokemon/Worlds/default.wld";
autocreate = "large";
install = [
3039823461
2619954303
2563851005
3378168037
3173371762
2800050107
2785100219
3018447913
2565540604
2563309347
2908170107
2669644269
3439924021
2599842771
2797518634
2565639705
3497111954
2563815443
2707400823
];
};
};
}