nix_optimize: Add optimization of store and automatic GC call
All checks were successful
check / check (push) Successful in 29s

This commit is contained in:
Florian RICHER 2025-01-26 21:19:35 +01:00
parent 2e0519fb94
commit bb5e2ceb90
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
4 changed files with 26 additions and 0 deletions

View file

@ -23,6 +23,10 @@
};
};
# Limit the number of generations to keep
# boot.loader.systemd-boot.configurationLimit = 10;
boot.loader.grub.configurationLimit = 10;
networking.hostName = "nixos-vm"; # Define your hostname.
users.users.florian.initialPassword = "test";

View file

@ -28,6 +28,10 @@
};
boot.loader.efi.canTouchEfiVariables = true;
# Limit the number of generations to keep
boot.loader.systemd-boot.configurationLimit = 10;
# boot.loader.grub.configurationLimit = 10;
networking.hostName = "nixos-desktop-perso"; # Define your hostname.
modules.system = {

View file

@ -17,6 +17,10 @@
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Limit the number of generations to keep
boot.loader.systemd-boot.configurationLimit = 10;
# boot.loader.grub.configurationLimit = 10;
networking.hostName = "nixos-laptop-perso"; # Define your hostname.
hardware.nvidia.prime = {

View file

@ -23,6 +23,20 @@
LC_TIME = "fr_FR.UTF-8";
};
# Perform garbage collection weekly to maintain low disk usage
nix.gc = {
automatic = true;
dates = "*-*-* 20:00:00";
options = "--delete-older-than 1w";
};
# Optimize storage
# You can also manually optimize the store via:
# nix-store --optimise
# Refer to the following link for more details:
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store
nix.settings.auto-optimise-store = true;
nixpkgs.config.allowUnfree = true;
services.udev.packages = [ pkgs.yubikey-personalization ];