Compare commits
5 Commits
e536daa8f2
...
4ccab1f61c
| Author | SHA1 | Date | |
|---|---|---|---|
|
4ccab1f61c
|
|||
|
ac564d4d96
|
|||
|
594ecdfef7
|
|||
|
131a2440c8
|
|||
|
bf47574b8c
|
@@ -118,6 +118,9 @@
|
|||||||
|
|
||||||
hardware.intelgpu.driver = "xe";
|
hardware.intelgpu.driver = "xe";
|
||||||
|
|
||||||
|
# Per-service 2MB hugepage budget calculated in service-configs.nix.
|
||||||
|
boot.kernel.sysctl."vm.nr_hugepages" = service_configs.hugepages_2m.total_pages;
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
# 6.12 LTS until 2026
|
# 6.12 LTS until 2026
|
||||||
kernelPackages = pkgs.linuxPackages_6_12_hardened;
|
kernelPackages = pkgs.linuxPackages_6_12_hardened;
|
||||||
|
|||||||
66
flake.lock
generated
66
flake.lock
generated
@@ -47,11 +47,11 @@
|
|||||||
},
|
},
|
||||||
"crane": {
|
"crane": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771796463,
|
"lastModified": 1772080396,
|
||||||
"narHash": "sha256-9bCDuUzpwJXcHMQYMS1yNuzYMmKO/CCwCexpjWOl62I=",
|
"narHash": "sha256-84W9UNtSk9DNMh43WBkOjpkbfODlmg+RDi854PnNgLE=",
|
||||||
"owner": "ipetkov",
|
"owner": "ipetkov",
|
||||||
"repo": "crane",
|
"repo": "crane",
|
||||||
"rev": "3d3de3313e263e04894f284ac18177bd26169bad",
|
"rev": "8525580bc0316c39dbfa18bd09a1331e98c9e463",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -89,11 +89,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1773025010,
|
"lastModified": 1773506317,
|
||||||
"narHash": "sha256-khlHllTsovXgT2GZ0WxT4+RvuMjNeR5OW0UYeEHPYQo=",
|
"narHash": "sha256-qWKbLUJpavIpvOdX1fhHYm0WGerytFHRoh9lVck6Bh0=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "disko",
|
||||||
"rev": "7b9f7f88ab3b339f8142dc246445abb3c370d3d3",
|
"rev": "878ec37d6a8f52c6c801d0e2a2ad554c75b9353c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -197,11 +197,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1772985280,
|
"lastModified": 1773264488,
|
||||||
"narHash": "sha256-FdrNykOoY9VStevU4zjSUdvsL9SzJTcXt4omdEDZDLk=",
|
"narHash": "sha256-rK0507bDuWBrZo+0zts9bCs/+RRUEHuvFE5DHWPxX/Q=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "8f736f007139d7f70752657dff6a401a585d6cbc",
|
"rev": "5c0f63f8d55040a7eed69df7e3fcdd15dfb5a04c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -263,11 +263,11 @@
|
|||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1772216104,
|
"lastModified": 1773344150,
|
||||||
"narHash": "sha256-1TnGN26vnCEQk5m4AavJZxGZTb/6aZyphemRPRwFUfs=",
|
"narHash": "sha256-JSsXufJy2zdg5XS5pRGlkwF1dqN+sWPmCgrvJsnhEzg=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "lanzaboote",
|
"repo": "lanzaboote",
|
||||||
"rev": "dbe5112de965bbbbff9f0729a9789c20a65ab047",
|
"rev": "d21013305ef39e1d9d2d06b161c3785ffad82281",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -285,11 +285,11 @@
|
|||||||
"systems": "systems_3"
|
"systems": "systems_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1772592046,
|
"lastModified": 1773456096,
|
||||||
"narHash": "sha256-+Lyl+mGVd0t2nlR6ODK/gvUHzMtF5qLlbTK+x5tCenU=",
|
"narHash": "sha256-vlV3HnHBxnfW4a2ifabH3L/3iGGjA5ejEP7XD7EOC+E=",
|
||||||
"owner": "Infinidoge",
|
"owner": "Infinidoge",
|
||||||
"repo": "nix-minecraft",
|
"repo": "nix-minecraft",
|
||||||
"rev": "483abf9ad6aeac1d61f2a5419ded2879f0c4795e",
|
"rev": "ce7440a5fced512773e8e695d8a7bd57f33c7e6d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -316,11 +316,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1773068389,
|
"lastModified": 1773375660,
|
||||||
"narHash": "sha256-vMrm7Pk2hjBRPnCSjhq1pH0bg350Z+pXhqZ9ICiqqCs=",
|
"narHash": "sha256-SEzUWw2Rf5Ki3bcM26nSKgbeoqi2uYy8IHVBqOKjX3w=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "44bae273f9f82d480273bab26f5c50de3724f52f",
|
"rev": "3e20095fe3c6cbb1ddcef89b26969a69a1570776",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -333,11 +333,11 @@
|
|||||||
"nixpkgs-p2pool-module": {
|
"nixpkgs-p2pool-module": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1764744779,
|
"lastModified": 1773298780,
|
||||||
"narHash": "sha256-15mhGU8HZq4e6U2WnIhQvJNuUmU5aIO0RHMjzv9gVZs=",
|
"narHash": "sha256-7awJKfaH2uTuuW6gyA/lmPPfSruObm7bIkiYADxZBro=",
|
||||||
"owner": "JacoMalan1",
|
"owner": "JacoMalan1",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "3784f8a0dc56806ffbc550701d3aa27436ebb3e5",
|
"rev": "501e6bb1697590473c87c2ff9d2a92043a8d0e06",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -373,11 +373,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771858127,
|
"lastModified": 1772024342,
|
||||||
"narHash": "sha256-Gtre9YoYl3n25tJH2AoSdjuwcqij5CPxL3U3xysYD08=",
|
"narHash": "sha256-+eXlIc4/7dE6EcPs9a2DaSY3fTA9AE526hGqkNID3Wg=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "49bbbfc218bf3856dfa631cead3b052d78248b83",
|
"rev": "6e34e97ed9788b17796ee43ccdbaf871a5c2b476",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -415,11 +415,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771988922,
|
"lastModified": 1772334676,
|
||||||
"narHash": "sha256-Fc6FHXtfEkLtuVJzd0B6tFYMhmcPLuxr90rWfb/2jtQ=",
|
"narHash": "sha256-Jrc0J3AH+iNJDlUze3+FJZv2R0BZnhANFnD52V4kyvI=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "f4443dc3f0b6c5e6b77d923156943ce816d1fcb9",
|
"rev": "9879be11f30fd3bbf848e653a7f991549e8973b5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -472,11 +472,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1773021923,
|
"lastModified": 1773369348,
|
||||||
"narHash": "sha256-ro+i3wNoD2p5FloGGlkCzdmzgBDeq2LJwaIpaI9Dk7Q=",
|
"narHash": "sha256-6UwMEAi6X3oMjKQm51i0+3i10DrsrSdXi/4YgmJxfhE=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "srvos",
|
"repo": "srvos",
|
||||||
"rev": "7f92c2bcbeb42ce87770a7565f0e6f92c8134354",
|
"rev": "f3f0277b1dee1bfd058c5b8b98cb25558d95f03f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -548,11 +548,11 @@
|
|||||||
"trackerlist": {
|
"trackerlist": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1773184165,
|
"lastModified": 1773529772,
|
||||||
"narHash": "sha256-uGD+QgYZD1ntXl43523bKziyBUs1c3ONi+n5FeFZre0=",
|
"narHash": "sha256-I+K0BCc7fNQp6N7mTE/3SIHfencR4l0+sRsom4xaZ8Y=",
|
||||||
"owner": "ngosang",
|
"owner": "ngosang",
|
||||||
"repo": "trackerslist",
|
"repo": "trackerslist",
|
||||||
"rev": "448eba328ad00172a4ba049ec9f9f073b9cd278b",
|
"rev": "7e16f4f09851ef5e196806bddc0526281f913d3e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ rec {
|
|||||||
postgres = {
|
postgres = {
|
||||||
socket = "/run/postgresql";
|
socket = "/run/postgresql";
|
||||||
dataDir = services_dir + "/sql";
|
dataDir = services_dir + "/sql";
|
||||||
|
shared_buffers_m = 128; # PostgreSQL default; update if you change shared_buffers
|
||||||
};
|
};
|
||||||
|
|
||||||
immich = {
|
immich = {
|
||||||
@@ -150,4 +151,25 @@ rec {
|
|||||||
moviesDir = torrents_path + "/media/movies";
|
moviesDir = torrents_path + "/media/movies";
|
||||||
tvDir = torrents_path + "/media/tv";
|
tvDir = torrents_path + "/media/tv";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Per-service 2MB hugepage budget.
|
||||||
|
# Each value is the service's hugepage consumption in MB, derived from
|
||||||
|
# its actual memory configuration. The kernel sysctl vm.nr_hugepages
|
||||||
|
# is set to total_pages so every service gets what it needs.
|
||||||
|
hugepages_2m = rec {
|
||||||
|
page_size_m = 2;
|
||||||
|
|
||||||
|
# RandomX dataset (2048MB) + cache (256MB) = 2304MB per instance.
|
||||||
|
# Both monerod and p2pool allocate their own full copy via MAP_HUGETLB.
|
||||||
|
randomx_instance_m = 2048 + 256;
|
||||||
|
|
||||||
|
services = {
|
||||||
|
minecraft_m = minecraft.memory.heap_size_m; # JVM heap via -XX:+UseLargePages
|
||||||
|
monerod_m = randomx_instance_m; # block verification dataset
|
||||||
|
p2pool_m = randomx_instance_m; # mining dataset
|
||||||
|
postgres_m = postgres.shared_buffers_m; # huge_pages = try (default)
|
||||||
|
};
|
||||||
|
|
||||||
|
total_pages = builtins.foldl' (a: b: a + b) 0 (builtins.attrValues services) / page_size_m;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,14 +27,6 @@
|
|||||||
boot.kernel.sysctl = {
|
boot.kernel.sysctl = {
|
||||||
# Disable autogroup for better scheduling of game server threads
|
# Disable autogroup for better scheduling of game server threads
|
||||||
"kernel.sched_autogroup_enabled" = 0;
|
"kernel.sched_autogroup_enabled" = 0;
|
||||||
|
|
||||||
# We want to determine the number of hugepages based on how many minecraft needs.
|
|
||||||
# This can be determined by dividing the heap size by the size of a large page.
|
|
||||||
# Doing this gives us how many large pages are needed.
|
|
||||||
# Then we add 300 to give some headroom.
|
|
||||||
"vm.nr_hugepages" =
|
|
||||||
(service_configs.minecraft.memory.heap_size_m / service_configs.minecraft.memory.large_page_size_m)
|
|
||||||
+ 300;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.minecraft-servers = {
|
services.minecraft-servers = {
|
||||||
@@ -110,8 +102,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
Lithium = fetchurl {
|
Lithium = fetchurl {
|
||||||
url = "https://cdn.modrinth.com/data/gvQqBUqZ/versions/qvNsoO3l/lithium-fabric-0.21.3%2Bmc1.21.11.jar";
|
url = "https://cdn.modrinth.com/data/gvQqBUqZ/versions/Ow7wA0kG/lithium-fabric-0.21.4%2Bmc1.21.11.jar";
|
||||||
sha512 = "2883739303f0bb602d3797cc601ed86ce6833e5ec313ddce675f3d6af3ee6a40b9b0a06dafe39d308d919669325e95c0aafd08d78c97acd976efde899c7810fd";
|
sha512 = "f14a5c3d2fad786347ca25083f902139694f618b7c103947f2fd067a7c5ee88a63e1ef8926f7d693ea79ed7d00f57317bae77ef9c2d630bf5ed01ac97a752b94";
|
||||||
};
|
};
|
||||||
|
|
||||||
NoChatReports = fetchurl {
|
NoChatReports = fetchurl {
|
||||||
|
|||||||
Reference in New Issue
Block a user