From 4bb8dd864cf5077018327d6f55058b87def03d45 Mon Sep 17 00:00:00 2001 From: polwex Date: Mon, 20 Oct 2025 09:08:14 +0700 Subject: no moar hanging --- hosts/base.nix | 10 ++++++++++ hosts/dev.nix | 18 ++++++++++++++++++ hosts/local/gui.nix | 3 +++ hosts/local/master/configuration.nix | 21 ++++++++++++++++++--- hosts/local/nvidia.nix | 7 +++++++ 5 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 hosts/dev.nix (limited to 'hosts') diff --git a/hosts/base.nix b/hosts/base.nix index 5a65df7..054a967 100644 --- a/hosts/base.nix +++ b/hosts/base.nix @@ -39,7 +39,17 @@ keep-outputs = true; keep-derivations = true; trusted-users = ["root" "y"]; + max-jobs = 2; + cores = 16; }; + # buildMachines = [{ + # hostName = "builder.lan"; + # system = "x86_64-linux"; + # protocol = "ssh"; + # supportedFeatures = ["kvm" "big-parallel" "cuda"]; + + # }]; + # distributedBuilds = true; }; programs.nh = { enable = true; diff --git a/hosts/dev.nix b/hosts/dev.nix new file mode 100644 index 0000000..ef6c761 --- /dev/null +++ b/hosts/dev.nix @@ -0,0 +1,18 @@ +{ + inputs, + pkgs, + lib, + config, + ... +}: { + # https://nixos.wiki/wiki/CCache + + programs.ccache = { + enable = true; + }; + nix.settings.extra-sandbox-paths = [config.programs.ccache.cacheDir]; + + # environment.systemPackages = with pkgs; + # [ + # ]; +} diff --git a/hosts/local/gui.nix b/hosts/local/gui.nix index b22f5bc..59676c1 100644 --- a/hosts/local/gui.nix +++ b/hosts/local/gui.nix @@ -51,5 +51,8 @@ signal-desktop telegram-desktop electrum + # xdg whatever bs + glib # gio + desktop-file-utils ]; } diff --git a/hosts/local/master/configuration.nix b/hosts/local/master/configuration.nix index 7b883d3..cad65c8 100644 --- a/hosts/local/master/configuration.nix +++ b/hosts/local/master/configuration.nix @@ -13,8 +13,8 @@ in { ../../linux.nix ../../unfree.nix #../../android.nix - # ../gui.nix - # ../i3.nix + ../gui.nix + ../i3.nix # ../gnome.nix # ../wayland.nix ../nvidia.nix @@ -56,7 +56,8 @@ in { zramSwap = { enable = true; - # algorithm = "zstd"; + memoryPercent = 100; + algorithm = "zstd"; # memoryPercent = 30; }; @@ -114,4 +115,18 @@ in { # }; # }; # }; + # stop fucking crashing + + systemd.services.nix-daemon.serviceConfig = { + MemoryHigh = "22G"; # throttle above this + MemoryMax = "28G"; # hard kill above this + # optional niceties: + CPUWeight = 50; + IOWeight = 50; + TasksMax = 4096; + # Let systemd-oomd preferentially kill these if needed: + ManagedOOMMemoryPressure = "kill"; + ManagedOOMMemoryPressureLimit = "50%"; + }; + systemd.oomd.enable = true; } diff --git a/hosts/local/nvidia.nix b/hosts/local/nvidia.nix index 3d6f603..b8b335a 100644 --- a/hosts/local/nvidia.nix +++ b/hosts/local/nvidia.nix @@ -28,10 +28,17 @@ in { nix.settings.substituters = [ "https://cuda-maintainers.cachix.org" "https://nix-community.cachix.org" + "https://huggingface.cachix.org" + + "https://nix-ai-stuff.cachix.org" + "https://ai.cachix.org" ]; nix.settings.trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" + "huggingface.cachix.org-1:ynTPbLS0W8ofXd9fDjk1KvoFky9K2jhxe6r4nXAkc/o=" + "nix-ai-stuff.cachix.org-1:WlUGeVCs26w9xF0/rjyg32PujDqbVMlSHufpj1fqix8=" + "ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc=" ]; services.xserver = { -- cgit v1.2.3