diff --git a/hosts/nixos-test/configuration.nix b/hosts/nixos-test/configuration.nix index fabfec8..af183ff 100644 --- a/hosts/nixos-test/configuration.nix +++ b/hosts/nixos-test/configuration.nix @@ -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"; diff --git a/hosts/perso-desktop/configuration.nix b/hosts/perso-desktop/configuration.nix index 2355a87..8d2f1d2 100644 --- a/hosts/perso-desktop/configuration.nix +++ b/hosts/perso-desktop/configuration.nix @@ -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 = { diff --git a/hosts/perso-laptop/configuration.nix b/hosts/perso-laptop/configuration.nix index c2b90bd..e067cfe 100644 --- a/hosts/perso-laptop/configuration.nix +++ b/hosts/perso-laptop/configuration.nix @@ -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 = { diff --git a/modules/system/common.nix b/modules/system/common.nix index 13638cf..55f878a 100644 --- a/modules/system/common.nix +++ b/modules/system/common.nix @@ -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 ];