All this just to get nyx to even build

This commit is contained in:
blahai 2025-01-12 18:35:44 +02:00
parent ed1aafe645
commit fdfd4e0434
No known key found for this signature in database
24 changed files with 2272 additions and 0 deletions

View file

@ -0,0 +1,6 @@
{
imports = [
./documentation.nix
./zram.nix
];
}

View file

@ -0,0 +1,18 @@
{lib, ...}: let
inherit (lib.modules) mkForce;
inherit (lib.attrsets) mapAttrs;
in {
documentation = mapAttrs (_: mkForce) {
enable = false;
dev.enable = false;
doc.enable = false;
info.enable = false;
nixos.enable = false;
man = {
enable = false;
generateCaches = false;
man-db.enable = false;
mandoc.enable = false;
};
};
}

View file

@ -0,0 +1,24 @@
{
lib,
config,
...
}: let
inherit (lib.modules) mkIf;
in {
# compress half of the ram to use as swap
# basically, get more memory per memory
zramSwap = {
enable = true;
algorithm = "zstd";
memoryPercent = 90; # defaults to 50
};
boot.kernel.sysctl = mkIf config.zramSwap.enable {
# zram is relatively cheap, prefer swap
"vm.swappiness" = 180;
"vm.watermark_boost_factor" = 0;
"vm.watermark_scale_factor" = 125;
# zram is in memory, no need to readahead
"vm.page-cluster" = 0;
};
}