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; diff --git a/hosts/modules/base.nix b/hosts/modules/base.nix index 2eab27a..46a9f37 100644 --- a/hosts/modules/base.nix +++ b/hosts/modules/base.nix @@ -29,17 +29,19 @@ # 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; + 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 ]; @@ -67,6 +69,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