Compare commits
57 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 598737859c | |||
| cabd26d232 | |||
| dced4e3a58 | |||
| 89931de313 | |||
| 8745a66a2a | |||
| 79fd698e12 | |||
| b349172b59 | |||
| 092883606a | |||
| 287458eec0 | |||
| 180521963a | |||
| 3db7568fa6 | |||
| 858e77735f | |||
| df27e80f4a | |||
| 9993ed52a7 | |||
| 70fa579331 | |||
| 6a106d606c | |||
| 05b6c5f450 | |||
| 0ebe87c5c3 | |||
| c3db68fad6 | |||
| d97d291c98 | |||
| 7791a23590 | |||
| c2924a2a58 | |||
| 3ac6b06f43 | |||
| 33f323d1ec | |||
| 23d4592783 | |||
| 35185583ee | |||
| b8b5084352 | |||
| 51b83d617e | |||
| 7e2c4b5169 | |||
| 90ed03a7ae | |||
| 3dc56278c9 | |||
| 6e02ff9c9c | |||
| 0b2ef091ee | |||
| 13041a04a5 | |||
| e9306f3515 | |||
| c03567baa3 | |||
| 4b6a8a6fa2 | |||
| acf495fae2 | |||
| b917409d10 | |||
| 2740bb8175 | |||
| 7d2be949ca | |||
| 68455e7ce4 | |||
| b2ecd770c8 | |||
| c48283a6e2 | |||
| 51ea852026 | |||
| 2844bce5a3 | |||
| 48c4c03b73 | |||
| 59163a8f06 | |||
| 81bf3f7118 | |||
| 0cdce64701 | |||
| e3202701ef | |||
| 21f3df0cb4 | |||
| 05f27f2927 | |||
| 73428f1501 | |||
| 3afe1f226f | |||
| 02c4edc908 | |||
| 37867492a9 |
10 changed files with 202 additions and 173 deletions
|
|
@ -7,5 +7,12 @@
|
||||||
- `thinkpad` - Thinkpad T480, i5 8350U, 16GB RAM, 256GB NVME
|
- `thinkpad` - Thinkpad T480, i5 8350U, 16GB RAM, 256GB NVME
|
||||||
- `homelab` - i7 8700T, 32GB RAM, 512GB NVME, 1TB 2.5" SATA
|
- `homelab` - i7 8700T, 32GB RAM, 512GB NVME, 1TB 2.5" SATA
|
||||||
|
|
||||||
|
## Todo
|
||||||
|
- Automatic backups to external drives.
|
||||||
|
- Better documentation and code structure.
|
||||||
|
- Use NixOS modules system.
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
- [orangc's flake](https://git.orangc.net/c/dots)
|
- [orangc's flake](https://git.orangc.net/c/dots)
|
||||||
|
- [vimjoyer's tutorials](https://www.youtube.com/@vimjoyer)
|
||||||
|
- [wallpaper source](https://github.com/er2de2/catppuccin_walls/blob/master/wallpapers_png/autumn_2.0.png)
|
||||||
|
|
@ -17,8 +17,10 @@
|
||||||
BAT_PCT=`${pkgs.acpi}/bin/acpi -b | ${pkgs.gnugrep}/bin/grep -P -o '[0-9]+(?=%)'`
|
BAT_PCT=`${pkgs.acpi}/bin/acpi -b | ${pkgs.gnugrep}/bin/grep -P -o '[0-9]+(?=%)'`
|
||||||
BAT_STA=`${pkgs.acpi}/bin/acpi -b | ${pkgs.gnugrep}/bin/grep -P -o '\w+(?=,)'`
|
BAT_STA=`${pkgs.acpi}/bin/acpi -b | ${pkgs.gnugrep}/bin/grep -P -o '\w+(?=,)'`
|
||||||
echo "`date` battery status:$BAT_STA percentage:$BAT_PCT"
|
echo "`date` battery status:$BAT_STA percentage:$BAT_PCT"
|
||||||
test $BAT_PCT -le 30 && test $BAT_PCT -gt 15 && test $BAT_STA = "Discharging" && DISPLAY=:0.0 ${pkgs.libnotify}/bin/notify-send "Low Battery" "Battery remaining: $BAT_PCT%."
|
export DISPLAY=:0
|
||||||
test $BAT_PCT -le 15 && test $BAT_STA = "Discharging" && DISPLAY=:0.0 ${pkgs.libnotify}/bin/notify-send -u critical "Low Battery" "Shutdown at 10%."
|
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus
|
||||||
|
test $BAT_PCT -le 30 && test $BAT_PCT -gt 15 && test $BAT_STA = "Discharging" && ${pkgs.libnotify}/bin/notify-send "Low Battery" "Battery remaining: $BAT_PCT%."
|
||||||
|
test $BAT_PCT -le 15 && test $BAT_STA = "Discharging" && ${pkgs.libnotify}/bin/notify-send -u critical "Low Battery" "Shutdown at 10%."
|
||||||
''} > /tmp/cron.batt.log 2>&1"
|
''} > /tmp/cron.batt.log 2>&1"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -49,10 +49,20 @@
|
||||||
initLua = ''
|
initLua = ''
|
||||||
vim.opt.clipboard = "unnamedplus"
|
vim.opt.clipboard = "unnamedplus"
|
||||||
vim.opt.termguicolors = true
|
vim.opt.termguicolors = true
|
||||||
|
vim.g.clipboard = {
|
||||||
|
name = "OSC 52",
|
||||||
|
copy = {
|
||||||
|
["+"] = require("vim.ui.clipboard.osc52").copy("+"),
|
||||||
|
["*"] = require("vim.ui.clipboard.osc52").copy("*"),
|
||||||
|
},
|
||||||
|
paste = {
|
||||||
|
["+"] = require("vim.ui.clipboard.osc52").paste("+"),
|
||||||
|
["*"] = require("vim.ui.clipboard.osc52").paste("*"),
|
||||||
|
},
|
||||||
|
}
|
||||||
require("nvim-tree").setup()
|
require("nvim-tree").setup()
|
||||||
vim.api.nvim_create_autocmd("VimEnter", {
|
vim.api.nvim_create_autocmd("VimEnter", {
|
||||||
callback = function()
|
callback = function()
|
||||||
-- vim.cmd("NvimTreeOpen")
|
|
||||||
vim.cmd("set nu")
|
vim.cmd("set nu")
|
||||||
vim.cmd.wincmd 'p'
|
vim.cmd.wincmd 'p'
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,9 @@
|
||||||
"cd" = "z";
|
"cd" = "z";
|
||||||
|
|
||||||
"sys" = "sudo systemctl --runtime";
|
"sys" = "sudo systemctl --runtime";
|
||||||
"sys-log" = "journalctl -f -b -u";
|
"sys-log" = "journalctl -o cat -f -b -u";
|
||||||
"user" = "systemctl --user --runtime";
|
"user" = "systemctl --user --runtime";
|
||||||
"user-log" = "journalctl -f -b --user-unit";
|
"user-log" = "journalctl -o cat -f -b --user-unit";
|
||||||
|
|
||||||
"ts" = "sudo tailscale";
|
"ts" = "sudo tailscale";
|
||||||
"tsip" = "tailscale ip -4";
|
"tsip" = "tailscale ip -4";
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,101 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
pages = [
|
pages = [
|
||||||
|
{
|
||||||
|
name = "Dashboard";
|
||||||
|
show-mobile-header = true;
|
||||||
|
width = "slim";
|
||||||
|
columns = [
|
||||||
|
{
|
||||||
|
size = "small";
|
||||||
|
widgets = [
|
||||||
|
{
|
||||||
|
type = "monitor";
|
||||||
|
title = "Critical Systems";
|
||||||
|
cache = "15s";
|
||||||
|
style = "compact";
|
||||||
|
show-failing-only = true;
|
||||||
|
sites = map (e: {
|
||||||
|
same-tab = true;
|
||||||
|
allow-insecure = true;
|
||||||
|
title = builtins.elemAt e 0;
|
||||||
|
url = builtins.elemAt e 1;
|
||||||
|
}) monitor;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "dns-stats";
|
||||||
|
title = "DNS Stats";
|
||||||
|
service = "adguard";
|
||||||
|
url = "http://localhost:8088/";
|
||||||
|
hour-format = "12h";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "bookmarks";
|
||||||
|
groups = [
|
||||||
|
{
|
||||||
|
links = [{
|
||||||
|
same-tab = true;
|
||||||
|
title = "NixFlake";
|
||||||
|
icon = "si:nixos";
|
||||||
|
url = "https://flake.satr14.my.id";
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
links = map (e: {
|
||||||
|
same-tab = true;
|
||||||
|
title = builtins.elemAt e 0;
|
||||||
|
icon = "si:${builtins.elemAt e 1}";
|
||||||
|
url = builtins.elemAt e 2;
|
||||||
|
alt-status-codes = [ 401 ];
|
||||||
|
}) bookmarks;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "to-do";
|
||||||
|
id = "tasks";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
size = "full";
|
||||||
|
widgets = [
|
||||||
|
{
|
||||||
|
type = "server-stats";
|
||||||
|
servers = [{
|
||||||
|
type = "local";
|
||||||
|
mountpoints = {
|
||||||
|
"/boot".hide = true;
|
||||||
|
"/nix/store".hide = true;
|
||||||
|
"/var/lib/vaultwarden".hide = true;
|
||||||
|
"/var/lib/private/cryptpad".hide = true;
|
||||||
|
"/var/lib/acme/proxy.satr14.my.id".hide = true;
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "monitor";
|
||||||
|
cache = "1m";
|
||||||
|
title = "Services";
|
||||||
|
sites = map (e: {
|
||||||
|
same-tab = true;
|
||||||
|
allow-insecure = true;
|
||||||
|
title = builtins.elemAt e 0;
|
||||||
|
icon = "si:${builtins.elemAt e 1}";
|
||||||
|
url = builtins.elemAt e 2;
|
||||||
|
check-url = builtins.elemAt e 3;
|
||||||
|
}) homelab.dash;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "docker-containers";
|
||||||
|
title = "Containers";
|
||||||
|
format-container-names = true;
|
||||||
|
hide-by-default = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
{
|
{
|
||||||
name = "Home";
|
name = "Home";
|
||||||
show-mobile-header = true;
|
show-mobile-header = true;
|
||||||
|
|
@ -187,101 +282,6 @@ in {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
|
||||||
name = "Dashboard";
|
|
||||||
show-mobile-header = true;
|
|
||||||
width = "slim";
|
|
||||||
columns = [
|
|
||||||
{
|
|
||||||
size = "small";
|
|
||||||
widgets = [
|
|
||||||
{
|
|
||||||
type = "monitor";
|
|
||||||
title = "Critical Systems";
|
|
||||||
cache = "15s";
|
|
||||||
style = "compact";
|
|
||||||
show-failing-only = true;
|
|
||||||
sites = map (e: {
|
|
||||||
same-tab = true;
|
|
||||||
allow-insecure = true;
|
|
||||||
title = builtins.elemAt e 0;
|
|
||||||
url = builtins.elemAt e 1;
|
|
||||||
}) monitor;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "dns-stats";
|
|
||||||
title = "DNS Stats";
|
|
||||||
service = "adguard";
|
|
||||||
url = "http://localhost:8088/";
|
|
||||||
hour-format = "12h";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "bookmarks";
|
|
||||||
groups = [
|
|
||||||
{
|
|
||||||
links = [{
|
|
||||||
same-tab = true;
|
|
||||||
title = "NixFlake";
|
|
||||||
icon = "si:nixos";
|
|
||||||
url = "https://flake.satr14.my.id";
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
links = map (e: {
|
|
||||||
same-tab = true;
|
|
||||||
title = builtins.elemAt e 0;
|
|
||||||
icon = "si:${builtins.elemAt e 1}";
|
|
||||||
url = builtins.elemAt e 2;
|
|
||||||
alt-status-codes = [ 401 ];
|
|
||||||
}) bookmarks;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "to-do";
|
|
||||||
id = "tasks";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
size = "full";
|
|
||||||
widgets = [
|
|
||||||
{
|
|
||||||
type = "server-stats";
|
|
||||||
servers = [{
|
|
||||||
type = "local";
|
|
||||||
mountpoints = {
|
|
||||||
"/boot".hide = true;
|
|
||||||
"/nix/store".hide = true;
|
|
||||||
"/var/lib/vaultwarden".hide = true;
|
|
||||||
"/var/lib/private/cryptpad".hide = true;
|
|
||||||
"/var/lib/acme/proxy.satr14.my.id".hide = true;
|
|
||||||
};
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "monitor";
|
|
||||||
cache = "1m";
|
|
||||||
title = "Services";
|
|
||||||
sites = map (e: {
|
|
||||||
same-tab = true;
|
|
||||||
allow-insecure = true;
|
|
||||||
title = builtins.elemAt e 0;
|
|
||||||
icon = "si:${builtins.elemAt e 1}";
|
|
||||||
url = builtins.elemAt e 2;
|
|
||||||
check-url = builtins.elemAt e 3;
|
|
||||||
}) homelab.dash;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "docker-containers";
|
|
||||||
title = "Containers";
|
|
||||||
format-container-names = true;
|
|
||||||
hide-by-default = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
url = "http://localhost:5080"; #"https://git.proxy.${homelab.domain}";
|
url = "http://localhost:5080"; #"https://git.proxy.${homelab.domain}";
|
||||||
tokenFile = "/mnt/data/apps/forgejo/token-runner";
|
tokenFile = "/mnt/data/apps/forgejo/token-runner";
|
||||||
labels = [ "self-hosted:host" ];
|
labels = [ "self-hosted:host" ];
|
||||||
hostPackages = with pkgs; [ bash coreutils git nix openssh nodejs ];
|
hostPackages = with pkgs; [ bash coreutils git nix openssh bun ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
systemd.services = {
|
systemd.services = {
|
||||||
|
|
|
||||||
|
|
@ -1,75 +1,65 @@
|
||||||
{ inputs, lib, pkgs, ... }: let
|
{ inputs, lib, pkgs, ... }: let
|
||||||
ram-allocation = "10240M";
|
production = true;
|
||||||
# auth-server = "https://mc.satr14.my.id"; # TODO: self hosted drasl server
|
ram-allocation-mb = 12288;
|
||||||
|
rcon-pass = "howdy";
|
||||||
modpack = let
|
modpack = let
|
||||||
commit = "667aadf36aac9b0689289f4988a76b924bbb9cbc";
|
commit = "8523f89493ace13087eb68cd9fe3b5eb4f669440";
|
||||||
|
path = if production then "commit/${commit}" else "branch/main";
|
||||||
in pkgs.fetchPackwizModpack {
|
in pkgs.fetchPackwizModpack {
|
||||||
packHash = "sha256-sNWuqTIpqnwxhoof5PkJXrvVE5x/wnhc3LoqomjYBNs=";
|
packHash = "sha256-xB9Oc/aneogSQ9r7L42vyVM6xwq+QkoTaXYNuUzeo6M=";
|
||||||
url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml";
|
url = "https://git.satr14.my.id/satr14/server-modpack/raw/${path}/pack.toml";
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
imports = [ inputs.mc.nixosModules.minecraft-servers ];
|
imports = [ inputs.mc.nixosModules.minecraft-servers ];
|
||||||
nixpkgs.overlays = [ inputs.mc.overlay ];
|
nixpkgs.overlays = [ inputs.mc.overlay ];
|
||||||
|
|
||||||
|
powerManagement.cpuFreqGovernor = "powersave"; # performance governor causes overheating and thermal throttling, works fine with powesave
|
||||||
|
boot.kernel.sysctl = {
|
||||||
|
"vm.nr_hugepages" = (ram-allocation-mb / 2) + 512; # (heap_mb / 2MB per page) + 512 pages (1GB) for ZGC off-heap overhead
|
||||||
|
"vm.swappiness" = 10;
|
||||||
|
};
|
||||||
|
|
||||||
services.minecraft-servers = {
|
services.minecraft-servers = {
|
||||||
enable = true;
|
enable = true;
|
||||||
eula = true;
|
eula = true;
|
||||||
managementSystem.systemd-socket.enable = true; # Referenced but unset environment variable evaluates to an empty string: MAINPID
|
managementSystem.systemd-socket.enable = true;
|
||||||
# ^^^ https://github.com/Infinidoge/nix-minecraft/issues/119
|
# ^^^ https://github.com/Infinidoge/nix-minecraft/issues/119
|
||||||
|
|
||||||
servers.mc0-explorers-creativity = {
|
# TODO: figure out how to set gamerules on start
|
||||||
|
# gamerules to disable: locator_bar, mob_explosion_drop_decay, (and possibly) reduced_debug_info, global_sound_events
|
||||||
|
# gamerules to enable (temporarily): noend:disable_end
|
||||||
|
|
||||||
|
servers.da-s3 = {
|
||||||
enable = true;
|
enable = true;
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
restart = "always";
|
restart = "always";
|
||||||
enableReload = false; # NOTE: development phase, disable in production
|
enableReload = production;
|
||||||
|
# extraReload = ''
|
||||||
|
# function rcon() {
|
||||||
|
# ${pkgs.rcon-cli}/bin/rcon-cli -p ${rcon-pass} $@
|
||||||
|
# }
|
||||||
|
|
||||||
package = pkgs.fabricServers.fabric-1_21_11.override {
|
# rcon "gamerule locator_bar false"
|
||||||
jre_headless = pkgs.javaPackages.compiler.temurin-bin.jre-25;
|
# rcon "gamerule mob_explosion_drop_decay false"
|
||||||
loaderVersion = "0.19.2";
|
# rcon "gamerule reduced_debug_info false"
|
||||||
|
# rcon "gamerule global_sound_events false"
|
||||||
|
# '';
|
||||||
|
|
||||||
|
operators = lib.mkIf (!production) {
|
||||||
|
"satr14" = {
|
||||||
|
uuid = "54441a30-fe73-46e7-adca-c476bd4fc6d2";
|
||||||
|
bypassesPlayerLimit = true;
|
||||||
|
level = 4;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
jvmOpts = let
|
|
||||||
flags = [
|
|
||||||
"-Xms${ram-allocation}"
|
|
||||||
"-Xmx${ram-allocation}"
|
|
||||||
"--add-modules=jdk.incubator.vector"
|
|
||||||
|
|
||||||
# Custom auth server
|
|
||||||
# "-Dminecraft.api.env=custom"
|
|
||||||
# "-Dminecraft.api.auth.host=${auth-server}/auth"
|
|
||||||
# "-Dminecraft.api.account.host=${auth-server}/account"
|
|
||||||
# "-Dminecraft.api.profiles.host=${auth-server}/account"
|
|
||||||
# "-Dminecraft.api.session.host=${auth-server}/session"
|
|
||||||
# "-Dminecraft.api.services.host=${auth-server}/services"
|
|
||||||
|
|
||||||
# Aikar's GC flags (tuned for 10GB)
|
|
||||||
"-XX:+UseG1GC"
|
|
||||||
"-XX:+ParallelRefProcEnabled"
|
|
||||||
"-XX:MaxGCPauseMillis=200"
|
|
||||||
"-XX:+UnlockExperimentalVMOptions"
|
|
||||||
"-XX:+DisableExplicitGC"
|
|
||||||
"-XX:+AlwaysPreTouch"
|
|
||||||
"-XX:G1HeapWastePercent=5"
|
|
||||||
"-XX:G1MixedGCCountTarget=4"
|
|
||||||
"-XX:InitiatingHeapOccupancyPercent=15"
|
|
||||||
"-XX:G1MixedGCLiveThresholdPercent=90"
|
|
||||||
"-XX:G1RSetUpdatingPauseTimePercent=5"
|
|
||||||
"-XX:SurvivorRatio=32"
|
|
||||||
"-XX:+PerfDisableSharedMem"
|
|
||||||
"-XX:MaxTenuringThreshold=1"
|
|
||||||
"-Dusing.aikars.flags=https://mcflags.emc.gs"
|
|
||||||
"-Daikars.new.flags=true"
|
|
||||||
"-XX:G1NewSizePercent=30"
|
|
||||||
"-XX:G1MaxNewSizePercent=40"
|
|
||||||
"-XX:G1HeapRegionSize=8M"
|
|
||||||
"-XX:G1ReservePercent=20"
|
|
||||||
];
|
|
||||||
in lib.concatStringsSep " " flags;
|
|
||||||
|
|
||||||
serverProperties = {
|
serverProperties = {
|
||||||
|
# server-ip = "localhost";
|
||||||
server-port = 25565;
|
server-port = 25565;
|
||||||
server-name = "Digit Association";
|
server-name = "Minecraft Server";
|
||||||
motd = "§lSeason 3 TESTING§r - §dExplorers Creativity 🔥";
|
motd = "§lSeason 3§r - §dExplorers Creativity 🔥";
|
||||||
|
log-ips = false; # TODO: figure out how to get ips from cloudflared tunnel
|
||||||
|
|
||||||
difficulty = "normal";
|
difficulty = "normal";
|
||||||
gamemode = "survival";
|
gamemode = "survival";
|
||||||
|
|
@ -84,26 +74,41 @@ in {
|
||||||
allow-flight = false;
|
allow-flight = false;
|
||||||
player-idle-timeout = 0;
|
player-idle-timeout = 0;
|
||||||
|
|
||||||
# resource-pack = "https://cdn.satr14.my.id/public/fullslide-1.21.11.zip";
|
view-distance = 12;
|
||||||
# resource-pack-sha1 = "e0958dcef5755286f390c22280700c471ec34a65";
|
simulation-distance = 4;
|
||||||
# resource-pack-enforce = false;
|
|
||||||
|
|
||||||
simulation-distance = 16;
|
|
||||||
view-distance = 4;
|
|
||||||
|
|
||||||
enable-rcon = true;
|
enable-rcon = true;
|
||||||
sync-chunk-writes = false;
|
sync-chunk-writes = false;
|
||||||
"rcon.password" = "howdy";
|
"rcon.password" = rcon-pass;
|
||||||
"rcon.port" = 25575;
|
"rcon.port" = 25575;
|
||||||
};
|
};
|
||||||
|
|
||||||
symlinks = {
|
symlinks = lib.mapAttrs'
|
||||||
# "resources/datapack/required" = "${modpack}/datapacks";
|
(name: _: lib.nameValuePair "mods/${name}" "${modpack}/mods/${name}")
|
||||||
"mods" = "${modpack}/mods";
|
(builtins.readDir "${modpack}/mods");
|
||||||
|
|
||||||
# "server-icon.png" = "${modpack}/server-icon.png";
|
package = pkgs.fabricServers.fabric-1_21_11.override {
|
||||||
# "config" = "";
|
jre_headless = pkgs.javaPackages.compiler.temurin-bin.jdk-25;
|
||||||
|
loaderVersion = "0.19.2";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
jvmOpts = let flags = [
|
||||||
|
"-Xms${toString ram-allocation-mb}M"
|
||||||
|
"-Xmx${toString ram-allocation-mb}M"
|
||||||
|
|
||||||
|
"-XX:+UseZGC" # Use ZGC (requires Java v25+, 8+ CPU cores, 10GB+ RAM)
|
||||||
|
"-XX:+UseCompactObjectHeaders" # Use compact object headers (requires Java v16+, saves a couple of bits per object)
|
||||||
|
|
||||||
|
"--add-modules=jdk.incubator.vector" # Exposes SIMD instructions (requires full JDK, useful with performance mods)
|
||||||
|
"-XX:+UseLargePages" # Large pages support (requires hugepages configured on the system)
|
||||||
|
"-XX:+AlwaysPreTouch" # Pre-allocates memory on startup, OS claims it immediately for JVM instead of negotiating it
|
||||||
|
"-XX:+DisableExplicitGC" # Disables mods from manually invoking the GC
|
||||||
|
"-XX:+PerfDisableSharedMem" # Disables constant /tmp writes for JVM metrics
|
||||||
|
"-XX:ZAllocationSpikeTolerance=5" # Helps when server is active with many players
|
||||||
|
"-XX:SoftMaxHeapSize=${toString (ram-allocation-mb - 2048)}M" # Leave 2GB headroom
|
||||||
|
"-XX:ZCollectionInterval=1" # Force a GC cycle at minimum every second
|
||||||
|
"-XX:ConcGCThreads=8" # Threads ZGC uses for concurrent work
|
||||||
|
]; in lib.concatStringsSep " " flags;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
ntfs3g
|
ntfs3g
|
||||||
exfatprogs
|
exfatprogs
|
||||||
smartmontools
|
smartmontools
|
||||||
|
rclone
|
||||||
ncdu
|
ncdu
|
||||||
ventoy-full-qt
|
ventoy-full-qt
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,12 +35,15 @@ in {
|
||||||
|
|
||||||
users.users.root.openssh.authorizedKeys.keys = homelab.ssh-keys;
|
users.users.root.openssh.authorizedKeys.keys = homelab.ssh-keys;
|
||||||
|
|
||||||
services.tailscale = {
|
services = {
|
||||||
enable = true;
|
netbird.enable = true;
|
||||||
authKeyFile = "/mnt/data/apps/tailscale/authkey";
|
tailscale = {
|
||||||
useRoutingFeatures = "server";
|
enable = true;
|
||||||
extraUpFlags = ts-flags;
|
authKeyFile = "/mnt/data/apps/tailscale/authkey";
|
||||||
extraSetFlags = ts-flags;
|
useRoutingFeatures = "server";
|
||||||
|
extraUpFlags = ts-flags;
|
||||||
|
extraSetFlags = ts-flags;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
extraGroups = [
|
extraGroups = [
|
||||||
"networkmanager"
|
"networkmanager"
|
||||||
|
"minecraft"
|
||||||
"wheel"
|
"wheel"
|
||||||
"dialout"
|
"dialout"
|
||||||
"libvirtd"
|
"libvirtd"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue