diff --git a/hosts/jelly01/configuration.nix b/hosts/jelly01/configuration.nix index 048ae1c..2e69519 100644 --- a/hosts/jelly01/configuration.nix +++ b/hosts/jelly01/configuration.nix @@ -64,9 +64,5 @@ vault.enable = true; homelab.deploy.enable = true; - zramSwap = { - enable = true; - }; - system.stateVersion = "23.11"; # Did you read the comment? } diff --git a/hosts/nix-cache01/default.nix b/hosts/nix-cache01/default.nix index 435b31e..e5795a5 100644 --- a/hosts/nix-cache01/default.nix +++ b/hosts/nix-cache01/default.nix @@ -4,6 +4,5 @@ ./configuration.nix ../../services/nix-cache ../../services/actions-runner - ./zram.nix ]; } diff --git a/hosts/nix-cache01/zram.nix b/hosts/nix-cache01/zram.nix deleted file mode 100644 index 1b0509c..0000000 --- a/hosts/nix-cache01/zram.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - zramSwap = { - enable = true; - }; -} diff --git a/system/default.nix b/system/default.nix index a04e2bb..9ba5d06 100644 --- a/system/default.nix +++ b/system/default.nix @@ -12,5 +12,6 @@ ./pki/root-ca.nix ./sshd.nix ./vault-secrets.nix + ./zram.nix ]; } diff --git a/system/zram.nix b/system/zram.nix new file mode 100644 index 0000000..bb90208 --- /dev/null +++ b/system/zram.nix @@ -0,0 +1,8 @@ +# Compressed swap in RAM +# +# Provides overflow memory during Nix builds and upgrades. +# Prevents OOM kills on low-memory hosts (2GB VMs). +{ ... }: +{ + zramSwap.enable = true; +}