pinwheel: Use option for gc configuration limit

This commit is contained in:
Alexander Heldt
2024-08-18 14:44:45 +02:00
parent 1f45893928
commit 4e8848b990
2 changed files with 18 additions and 3 deletions

View File

@@ -1,14 +1,27 @@
{ inputs, pkgs, config, ... }:
{ inputs, pkgs, lib, config, ... }:
let
configurationLimit = config.mod.gc.configurationLimit;
in
{
imports = [ inputs.nix-gc-env.nixosModules.default ];
options = {
mod.gc = {
configurationLimit = lib.mkOption {
type = lib.types.int;
default = 10;
description = "number of configuration generations to keep";
};
};
};
config = {
nix.gc = {
automatic = true;
dates = "weekly";
# `delete_generations` added by nix-gc-env
delete_generations = "+${builtins.toString config.boot.loader.systemd-boot.configurationLimit}";
delete_generations = "+${builtins.toString configurationLimit}";
};
boot = {
@@ -23,7 +36,7 @@
loader = {
systemd-boot = {
enable = true;
configurationLimit = 10;
inherit configurationLimit;
};
efi.canTouchEfiVariables = true;

View File

@@ -8,6 +8,8 @@ in
config = {
mod = {
gc.configurationLimit = 10;
bluetooth.enable = true;
nix-index.enable = false;
greetd.enable = true;