From 60ccdd47cdaf9ff2e2e9367db2ec262bb7af2ccf Mon Sep 17 00:00:00 2001 From: XNM Date: Thu, 9 Nov 2023 18:36:55 +0200 Subject: [PATCH] added autoUpgrade and automatic GC for the system --- nixos/configuration.nix | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index e5ebcb2..8aa4d0d 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -130,10 +130,36 @@ nix.settings = { experimental-features = [ "nix-command" "flakes" ]; auto-optimise-store = true; - substituters = ["https://hyprland.cachix.org"]; - trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; }; + # Optimize storage and automatic scheduled GC running + # If you want to run GC manually, use commands: + # `nix-store --optimize` for finding and eliminating redundant copies of identical store paths + # `nix-store --gc` for optimizing the nix store and removing unreferenced and obsolete store paths + # `nix-collect-garbage -d` for deleting old generations of user profiles + nix.optimise.automatic = true; + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 15d"; + }; + + # Change runtime directory size + services.logind.extraConfig = "RuntimeDirectorySize=4G"; + + # Scheduled auto upgrade system (this is only for system upgrades, + # if you want to upgrade cargo\npm\pip global packages, docker containers or different part of the system + # or get really full system upgrade, use `topgrade` CLI utility manually instead. + # I recommend to use `topgrade` once a week or at least once a month) + system.autoUpgrade = { + enable = true; + operation = "switch"; # If you don't want to apply updates immediately, only after rebooting, use `boot` option in this case + flake = "/etc/nixos"; + flags = [ "--update-input" "nixpkgs" "--commit-lock-file" ]; + dates = "daily"; + # channel = "https://nixos.org/channels/nixos-unstable"; + }; + # Linux Kernel boot.kernelPackages = pkgs.linuxKernel.packages.linux_zen; @@ -459,17 +485,19 @@ cargo-spellcheck cargo-modules cargo-bloat - # cargo bacon taplo #toml formatter & lsp lldb + llvmPackages.bintools gcc13 + wasmedge lunatic + # wasm3 + license-generator git-ignore - xh wezterm cool-retro-term