Compare commits

...
Sign in to create a new pull request.

57 commits

Author SHA1 Message Date
598737859c todo
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 5s
2026-06-04 13:52:35 +07:00
cabd26d232 prod toggle 2026-06-04 13:52:35 +07:00
dced4e3a58 add bun 2026-06-04 13:52:35 +07:00
89931de313 enable netbird
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 3m48s
2026-05-30 18:29:01 +07:00
8745a66a2a update hash
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 34s
2026-05-19 17:37:50 +07:00
79fd698e12 update modpack
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 4m24s
2026-05-19 17:28:15 +07:00
b349172b59 jvm tuning
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 29s
2026-05-17 13:11:18 +07:00
092883606a switch dashboard to be main page
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 25s
2026-05-17 08:57:32 +07:00
287458eec0 disable ip logging
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 30s
2026-05-17 07:59:29 +07:00
180521963a [skip ci] todo comments 2026-05-17 07:53:54 +07:00
3db7568fa6 [skip ci] fix comment 2026-05-17 07:51:48 +07:00
858e77735f [skip ci] add extra notes 2026-05-17 07:51:20 +07:00
df27e80f4a [skip ci] small note 2026-05-17 07:37:57 +07:00
9993ed52a7 update hash
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 29s
2026-05-17 07:36:43 +07:00
70fa579331 update modpack and add me as an op
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 31s
2026-05-17 07:35:48 +07:00
6a106d606c add clipboard support
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 28s
2026-05-17 07:23:54 +07:00
05b6c5f450 update hash
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 28s
2026-05-15 21:02:56 +07:00
0ebe87c5c3 update modpack
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 31s
2026-05-15 21:01:29 +07:00
c3db68fad6 try powersave
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 29s
2026-05-14 09:21:54 +07:00
d97d291c98 set to perf overclock
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 28s
2026-05-14 09:08:05 +07:00
7791a23590 shorten journal output
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 28s
2026-05-13 15:18:29 +07:00
c2924a2a58 enable jstat
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 29s
2026-05-13 15:15:01 +07:00
3ac6b06f43 fix luckperms error
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 28s
2026-05-12 21:28:06 +07:00
33f323d1ec cleanup config, use new dir, update hash
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 31s
2026-05-11 16:39:50 +07:00
23d4592783 cleanup flag config and update modpack
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 4m43s
2026-05-11 16:26:43 +07:00
35185583ee fix battery notif 2026-05-11 16:12:48 +07:00
b8b5084352 update hash
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 30s
2026-05-10 18:54:43 +07:00
51b83d617e update modpack
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 45s
2026-05-10 18:52:32 +07:00
7e2c4b5169 update hash
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 28s
2026-05-10 11:27:44 +07:00
90ed03a7ae update modpack
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 39s
2026-05-10 11:20:55 +07:00
3dc56278c9 zgc lag from pause fix 2026-05-10 10:50:02 +07:00
6e02ff9c9c remove datapacks 2026-05-10 10:49:39 +07:00
0b2ef091ee got some things mixed up :p
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 28s
2026-05-10 10:43:02 +07:00
13041a04a5 update hash
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 29s
2026-05-10 00:06:31 +07:00
e9306f3515 update modpack
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 38s
2026-05-10 00:03:51 +07:00
c03567baa3 update hash
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 29s
2026-05-09 23:57:24 +07:00
4b6a8a6fa2 refresh hash
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 39s
2026-05-09 23:56:17 +07:00
acf495fae2 update modpack
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 20s
2026-05-09 23:54:44 +07:00
b917409d10 update hash
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 28s
2026-05-09 23:49:38 +07:00
2740bb8175 update modpack
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 59s
2026-05-09 23:46:33 +07:00
7d2be949ca startpost remove
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 27s
2026-05-09 23:43:30 +07:00
68455e7ce4 fix bin path
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 27s
2026-05-09 23:41:18 +07:00
b2ecd770c8 fix rcon-cli path
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 27s
2026-05-09 23:40:13 +07:00
c48283a6e2 update hash
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 28s
2026-05-09 23:35:23 +07:00
51ea852026 update modpack and include datapacks
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 59s
2026-05-09 23:31:50 +07:00
2844bce5a3 add mc group and gamerule
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 27s
2026-05-09 20:40:07 +07:00
48c4c03b73 update hash
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 28s
2026-05-09 19:56:01 +07:00
59163a8f06 update modpack include worldgen
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 33s
2026-05-09 19:49:35 +07:00
81bf3f7118 update hash
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 31s
2026-05-09 14:23:15 +07:00
0cdce64701 dynamic large pages and update modpack
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 33s
2026-05-09 14:21:45 +07:00
e3202701ef wp source 2026-05-09 14:21:30 +07:00
21f3df0cb4 update hash
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 27s
2026-05-08 21:16:40 +07:00
05f27f2927 update fix 2
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 31s
2026-05-08 21:15:37 +07:00
73428f1501 update fix
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 31s
2026-05-08 21:12:56 +07:00
3afe1f226f update modpack and add credits to readme
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 32s
2026-05-08 21:09:20 +07:00
02c4edc908 add rclone
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 1m6s
2026-05-08 19:04:56 +07:00
37867492a9 performance tweaks (zgc, sysctl, jvmopts, etc)
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 59s
2026-05-08 16:33:02 +07:00
10 changed files with 202 additions and 173 deletions

View file

@ -7,5 +7,12 @@
- `thinkpad` - Thinkpad T480, i5 8350U, 16GB RAM, 256GB NVME
- `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
- [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)

View file

@ -17,8 +17,10 @@
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+(?=,)'`
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%."
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 DISPLAY=:0
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"
];
};

View file

@ -49,10 +49,20 @@
initLua = ''
vim.opt.clipboard = "unnamedplus"
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()
vim.api.nvim_create_autocmd("VimEnter", {
callback = function()
-- vim.cmd("NvimTreeOpen")
vim.cmd("set nu")
vim.cmd.wincmd 'p'
end,

View file

@ -37,9 +37,9 @@
"cd" = "z";
"sys" = "sudo systemctl --runtime";
"sys-log" = "journalctl -f -b -u";
"sys-log" = "journalctl -o cat -f -b -u";
"user" = "systemctl --user --runtime";
"user-log" = "journalctl -f -b --user-unit";
"user-log" = "journalctl -o cat -f -b --user-unit";
"ts" = "sudo tailscale";
"tsip" = "tailscale ip -4";

View file

@ -89,6 +89,101 @@ in {
};
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";
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;
}
];
}
];
}
];
};
};

View file

@ -45,7 +45,7 @@
url = "http://localhost:5080"; #"https://git.proxy.${homelab.domain}";
tokenFile = "/mnt/data/apps/forgejo/token-runner";
labels = [ "self-hosted:host" ];
hostPackages = with pkgs; [ bash coreutils git nix openssh nodejs ];
hostPackages = with pkgs; [ bash coreutils git nix openssh bun ];
};
};
systemd.services = {

View file

@ -1,75 +1,65 @@
{ inputs, lib, pkgs, ... }: let
ram-allocation = "10240M";
# auth-server = "https://mc.satr14.my.id"; # TODO: self hosted drasl server
production = true;
ram-allocation-mb = 12288;
rcon-pass = "howdy";
modpack = let
commit = "667aadf36aac9b0689289f4988a76b924bbb9cbc";
commit = "8523f89493ace13087eb68cd9fe3b5eb4f669440";
path = if production then "commit/${commit}" else "branch/main";
in pkgs.fetchPackwizModpack {
packHash = "sha256-sNWuqTIpqnwxhoof5PkJXrvVE5x/wnhc3LoqomjYBNs=";
url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml";
packHash = "sha256-xB9Oc/aneogSQ9r7L42vyVM6xwq+QkoTaXYNuUzeo6M=";
url = "https://git.satr14.my.id/satr14/server-modpack/raw/${path}/pack.toml";
};
in {
imports = [ inputs.mc.nixosModules.minecraft-servers ];
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 = {
enable = 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
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;
autoStart = true;
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 {
jre_headless = pkgs.javaPackages.compiler.temurin-bin.jre-25;
loaderVersion = "0.19.2";
# rcon "gamerule locator_bar false"
# rcon "gamerule mob_explosion_drop_decay false"
# 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 = {
# server-ip = "localhost";
server-port = 25565;
server-name = "Digit Association";
motd = "§lSeason 3 TESTING§r - §dExplorers Creativity 🔥";
server-name = "Minecraft Server";
motd = "§lSeason 3§r - §dExplorers Creativity 🔥";
log-ips = false; # TODO: figure out how to get ips from cloudflared tunnel
difficulty = "normal";
gamemode = "survival";
@ -84,26 +74,41 @@ in {
allow-flight = false;
player-idle-timeout = 0;
# resource-pack = "https://cdn.satr14.my.id/public/fullslide-1.21.11.zip";
# resource-pack-sha1 = "e0958dcef5755286f390c22280700c471ec34a65";
# resource-pack-enforce = false;
simulation-distance = 16;
view-distance = 4;
view-distance = 12;
simulation-distance = 4;
enable-rcon = true;
sync-chunk-writes = false;
"rcon.password" = "howdy";
"rcon.password" = rcon-pass;
"rcon.port" = 25575;
};
symlinks = {
# "resources/datapack/required" = "${modpack}/datapacks";
"mods" = "${modpack}/mods";
symlinks = lib.mapAttrs'
(name: _: lib.nameValuePair "mods/${name}" "${modpack}/mods/${name}")
(builtins.readDir "${modpack}/mods");
# "server-icon.png" = "${modpack}/server-icon.png";
# "config" = "";
package = pkgs.fabricServers.fabric-1_21_11.override {
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;
};
};
}

View file

@ -8,6 +8,7 @@
ntfs3g
exfatprogs
smartmontools
rclone
ncdu
ventoy-full-qt

View file

@ -35,13 +35,16 @@ in {
users.users.root.openssh.authorizedKeys.keys = homelab.ssh-keys;
services.tailscale = {
services = {
netbird.enable = true;
tailscale = {
enable = true;
authKeyFile = "/mnt/data/apps/tailscale/authkey";
useRoutingFeatures = "server";
extraUpFlags = ts-flags;
extraSetFlags = ts-flags;
};
};
virtualisation = {
oci-containers.backend = "docker";

View file

@ -7,6 +7,7 @@
shell = pkgs.zsh;
extraGroups = [
"networkmanager"
"minecraft"
"wheel"
"dialout"
"libvirtd"