Improvements to server
This commit is contained in:
@@ -8,6 +8,7 @@ let
|
||||
}
|
||||
) enabledConfigs;
|
||||
mergedContainers = lib.attrsets.mergeAttrsList (lib.map(e: e.containers) containerSetsList);
|
||||
allPathConfigs = lib.flatten (lib.map (e: e.paths or []) containerSetsList);
|
||||
in
|
||||
{
|
||||
config = lib.mkIf ( enabledConfigs != {} ) {
|
||||
@@ -17,5 +18,23 @@ in
|
||||
containers = mergedContainers;
|
||||
};
|
||||
|
||||
systemd.services.podman-gc = {
|
||||
description = "Podman garbage collection";
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = ''
|
||||
${pkgs.podman}/bin/podman container prune -f
|
||||
${pkgs.podman}/bin/podman image prune -f
|
||||
'';
|
||||
startAt = "weekly";
|
||||
};
|
||||
|
||||
system.activationScripts.container-setup-dirs = {
|
||||
deps = [ "users" "groups" ];
|
||||
text = lib.concatStringsSep "\n" (map (cfg: ''
|
||||
mkdir -p "${cfg.path}"
|
||||
chown ${cfg.owner} "${cfg.path}"
|
||||
chmod ${cfg.mode} "${cfg.path}"
|
||||
'') allPathConfigs);
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user