add auto gc

This commit is contained in:
Kopatz
2024-05-24 16:14:32 +02:00
parent cc5bf2766f
commit 873b9814d9

View File

@@ -1,9 +1,7 @@
{lib, inputs, config, pkgsVersion, ... }: { lib, inputs, config, pkgsVersion, ... }:
with lib; with lib;
let let cfg = config.custom.nix.settings;
cfg = config.custom.nix.settings; in {
in
{
options.custom.nix.settings = { options.custom.nix.settings = {
enable = mkEnableOption "Enables various nix settings"; enable = mkEnableOption "Enables various nix settings";
}; };
@@ -12,7 +10,16 @@ in
nix.optimise.automatic = true; nix.optimise.automatic = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.registry.nixpkgs.flake = pkgsVersion; nix.registry.nixpkgs.flake = pkgsVersion;
nix.nixPath = ["nixpkgs=flake:nixpkgs"]; nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
nix.extraOptions = ''
min-free = ${toString (100 * 1024 * 1024)}
max-free = ${toString (1024 * 1024 * 1024)}
'';
nix.nixPath = [ "nixpkgs=flake:nixpkgs" ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
##home-manager.users.${config.mainUser.name}.home.sessionVariables = { ##home-manager.users.${config.mainUser.name}.home.sessionVariables = {
## NIX_PATH = "nixpkgs=flake:nixpkgs$\{NIX_PATH:+:$NIX_PATH}"; ## NIX_PATH = "nixpkgs=flake:nixpkgs$\{NIX_PATH:+:$NIX_PATH}";