summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2023-02-26 11:45:41 -0500
committerseth <[email protected]>2023-02-26 11:45:41 -0500
commit2922c83bb4ebf7c80599c9479a08dfb3a1d3446b (patch)
treee7deaa1736ecd765f7253627accc7b50f2f9918f
parent2c181779426b72e48e10f32ad3169513bd6e9a68 (diff)
enable zram + ondemand governor for glados
-rw-r--r--hosts/common/security.nix5
-rw-r--r--hosts/glados/boot.nix7
-rw-r--r--hosts/glados/default.nix9
-rw-r--r--users/seth/shell/default.nix2
4 files changed, 18 insertions, 5 deletions
diff --git a/hosts/common/security.nix b/hosts/common/security.nix
index a6c7e57..260538a 100644
--- a/hosts/common/security.nix
+++ b/hosts/common/security.nix
@@ -5,11 +5,6 @@
auditd.enable = !wsl;
rtkit.enable = true;
sudo = {
- configFile = ''
- Defaults env_reset
- Defaults secure_path = /run/wrappers/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin
- Defaults editor = /run/current-system/sw/bin/vim,!env_editor
- '';
execWheelOnly = true;
extraRules = [
{
diff --git a/hosts/glados/boot.nix b/hosts/glados/boot.nix
index 6ff35ba..8e00b5a 100644
--- a/hosts/glados/boot.nix
+++ b/hosts/glados/boot.nix
@@ -16,6 +16,13 @@ in {
boot = {
kernelPackages = pinned-kernel.pkgs.linuxPackages_6_1;
+ kernel.sysctl = {
+ "vm.swappiness" = 100;
+ "vm.vfs_cache_pressure" = 500;
+ "vm.dirty_background_ratio" = 1;
+ "vm.dirty_ratio" = 50;
+ };
+
bootspec.enable = true;
loader.systemd-boot.enable = lib.mkForce false;
diff --git a/hosts/glados/default.nix b/hosts/glados/default.nix
index c1f9887..a6bc4ae 100644
--- a/hosts/glados/default.nix
+++ b/hosts/glados/default.nix
@@ -8,4 +8,13 @@ _: {
./network.nix
./services.nix
];
+
+ powerManagement.cpuFreqGovernor = "ondemand";
+
+ zramSwap = {
+ enable = true;
+ algorithm = "zstd";
+ swapDevices = 1;
+ memoryPercent = 50;
+ };
}
diff --git a/users/seth/shell/default.nix b/users/seth/shell/default.nix
index 3872731..e0e753b 100644
--- a/users/seth/shell/default.nix
+++ b/users/seth/shell/default.nix
@@ -7,6 +7,8 @@
home = {
sessionVariables = {
+ EDITOR = "nvim";
+ VISUAL = "$EDITOR";
GPG_TTY = "$(tty)";
CARGO_HOME = "${config.xdg.dataHome}/cargo";
RUSTUP_HOME = "${config.xdg.dataHome}/rustup";