mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 12:51:34 +01:00
gc: Enable on servers with gcroot cleanup only
This commit is contained in:
parent
b41d8bee99
commit
c6b56d87ff
4 changed files with 30 additions and 3 deletions
|
|
@ -21,6 +21,11 @@
|
||||||
boot.loader.grub.enable = true;
|
boot.loader.grub.enable = true;
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
gc = {
|
||||||
|
enable = true;
|
||||||
|
onlyCleanRoots = true;
|
||||||
|
};
|
||||||
|
|
||||||
tailscale.enable = true;
|
tailscale.enable = true;
|
||||||
|
|
||||||
nebula.node = {
|
nebula.node = {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,11 @@
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
gc = {
|
||||||
|
enable = true;
|
||||||
|
onlyCleanRoots = true;
|
||||||
|
};
|
||||||
|
|
||||||
tailscale = {
|
tailscale = {
|
||||||
enable = true;
|
enable = true;
|
||||||
exitNode.enable = true;
|
exitNode.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,11 @@
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
gc = {
|
||||||
|
enable = true;
|
||||||
|
onlyCleanRoots = true;
|
||||||
|
};
|
||||||
|
|
||||||
tailscale.enable = true;
|
tailscale.enable = true;
|
||||||
|
|
||||||
nebula.node = {
|
nebula.node = {
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,26 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.custom.services.gc;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.custom.services.gc.enable = lib.mkEnableOption "";
|
options.custom.services.gc = {
|
||||||
|
enable = lib.mkEnableOption "";
|
||||||
|
onlyCleanRoots = lib.mkEnableOption "";
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.custom.services.gc.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
programs.nh = {
|
programs.nh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
clean = {
|
clean = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
extraArgs = "--keep 10 --keep-since 7d";
|
extraArgs =
|
||||||
|
[
|
||||||
|
"--keep 10"
|
||||||
|
"--keep-since 7d"
|
||||||
|
(lib.optionalString cfg.onlyCleanRoots "--no-gc")
|
||||||
|
]
|
||||||
|
|> lib.concatStringsSep " ";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue