From f33d6be8921072ac44484bfb62cfeb197f34b562 Mon Sep 17 00:00:00 2001 From: Alexander Wainwright Date: Tue, 24 Feb 2026 12:20:06 +1000 Subject: [PATCH 1/4] Remove swap file --- hosts/modules/base.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hosts/modules/base.nix b/hosts/modules/base.nix index c69a3ff..f203480 100644 --- a/hosts/modules/base.nix +++ b/hosts/modules/base.nix @@ -16,12 +16,6 @@ # break fish man completion and apropos. documentation.man.generateCaches = false; - # enable a 1GB swap file - swapDevices = [{ - device = "/swapfile"; - size = 1024; - }]; - # enable zram. not totally sure if this does it in physical ram or just swap zramSwap.enable = true; From 3e9aa3f842d98cfd45a88995a313ca57e9d66df8 Mon Sep 17 00:00:00 2001 From: Alexander Wainwright Date: Tue, 24 Feb 2026 12:21:01 +1000 Subject: [PATCH 2/4] Change swap settings --- hosts/modules/base.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hosts/modules/base.nix b/hosts/modules/base.nix index f203480..c172ff8 100644 --- a/hosts/modules/base.nix +++ b/hosts/modules/base.nix @@ -19,8 +19,16 @@ # enable zram. not totally sure if this does it in physical ram or just swap zramSwap.enable = true; + boot.kernel.sysctl = { + "vm.swappiness" = 10; + }; + # enable earlyoom to stop the system becoming unresponsive when out of ram - services.earlyoom.enable = true; + services.earlyoom = { + enable = true; + freeMemThreshold = 10; + freeSwapThreshold = 90; + }; networking.firewall.allowedTCPPorts = [ 8000 8080 ]; From c504fea109eb806cad35036dbaa0eb7d5ba7745e Mon Sep 17 00:00:00 2001 From: Alexander Wainwright Date: Tue, 24 Feb 2026 12:21:43 +1000 Subject: [PATCH 3/4] Enable direnv --- hosts/modules/base.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hosts/modules/base.nix b/hosts/modules/base.nix index c172ff8..1eb5078 100644 --- a/hosts/modules/base.nix +++ b/hosts/modules/base.nix @@ -56,6 +56,19 @@ # fish shell programs.fish.enable = true; + # direnv + programs.direnv = { + enable = true; + package = pkgs.direnv; + silent = false; + loadInNixShell = true; + direnvrcExtra = ""; + nix-direnv = { + enable = true; + package = pkgs.nix-direnv; + }; + }; + # Create a library path that only applies to unpackaged programs by using # nix-ldo # https://nix.dev/guides/faq#how-to-run-non-nix-executables From 0838e60998ba69c4b890bee3334a7b718841859b Mon Sep 17 00:00:00 2001 From: Alexander Wainwright Date: Tue, 24 Feb 2026 12:26:01 +1000 Subject: [PATCH 4/4] Add direnv to home-manager --- alex/core.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/alex/core.nix b/alex/core.nix index 371e747..a314a46 100644 --- a/alex/core.nix +++ b/alex/core.nix @@ -16,6 +16,12 @@ tm = "tmux attach || tmux"; }; + programs.direnv = { + enable = true; + # enableFishIntegration = true; + nix-direnv.enable = true; +}; + home.file.".config/atuin/config.toml".source = ./atuin/config.toml; home.file.".config/nvim/init.lua".source = ./nvim/init.lua; home.file.".config/tmux/tmux.conf".source = ./tmux/tmux.conf;