tadpole: Use option for gc configuration limit
This commit is contained in:
@@ -1,14 +1,27 @@
|
|||||||
{ inputs, config, ... }:
|
{ inputs, lib, config, ... }:
|
||||||
|
let
|
||||||
|
configurationLimit = config.mod.gc.configurationLimit;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [ inputs.nix-gc-env.nixosModules.default ];
|
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 = {
|
config = {
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
automatic = true;
|
automatic = true;
|
||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
|
|
||||||
# `delete_generations` added by nix-gc-env
|
# `delete_generations` added by nix-gc-env
|
||||||
delete_generations = "+${builtins.toString config.boot.loader.systemd-boot.configurationLimit}";
|
delete_generations = "+${builtins.toString configurationLimit}";
|
||||||
};
|
};
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
@@ -17,7 +30,7 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
device = "/dev/sda";
|
device = "/dev/sda";
|
||||||
|
|
||||||
configurationLimit = 10;
|
inherit configurationLimit;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ in
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
mod = {
|
mod = {
|
||||||
|
gc.configurationLimit = 10;
|
||||||
|
|
||||||
ssh.enable = true;
|
ssh.enable = true;
|
||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user