From 95656c9cff3f24e05f400d0bee5daedd2d30ad82 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 23 Sep 2020 15:35:53 -0300 Subject: Enable automatic GC of NixOS --- TODOs.org | 4 +++- vps-configuration.nix | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/TODOs.org b/TODOs.org index a8ea8c5..a7ed8f7 100644 --- a/TODOs.org +++ b/TODOs.org @@ -27,7 +27,9 @@ No XMPP, for now, I'm stick with Matrix and their puppeting bridges. ** CANCELLED Fix conversejs login CLOSED: [2020-09-22 mar. 18:56] ** DOING Terraform restore from backup when provisioning -** DOING cron: borg, PostgreSQL backup and NixOS update and collect gargabe +** DONE cron: borg, PostgreSQL backup and NixOS update and collect gargabe +CLOSED: [2020-09-23 mer. 15:34] +- State "DONE" from "DOING" [2020-09-23 mer. 15:35] ** DOING snapshot with swap: nixos-rebuild switch takes too much memory Adding swap memory maybe be a lot slower, but allows me to stay inside the 512MB memory server plan ** DONE Configure PostgreSQL permissions correctly diff --git a/vps-configuration.nix b/vps-configuration.nix index 4897b95..5c7d790 100644 --- a/vps-configuration.nix +++ b/vps-configuration.nix @@ -66,6 +66,18 @@ in { interfaces.ens3.useDHCP = true; }; + nix = { + gc = { + automatic = true; + options = "--delete-older-than 7d"; + }; + # min-free 1G + extraOptions = '' + min-free = ${toString (1024 * 1024 * 1024)} + ''; + }; + + environment = { systemPackages = with pkgs; [ vim -- cgit v1.2.3