20 lines
575 B
Nix
20 lines
575 B
Nix
{ config, pkgs, lib, ... }:
|
|
let
|
|
cfg = config.syscfg.server.containers;
|
|
enabledConfigs = lib.filterAttrs (name: c: c.enable) cfg;
|
|
containerSetsList = lib.mapAttrsToList (name: containerCfg:
|
|
import (./defs + "/${name}.nix") {
|
|
inherit config pkgs lib ;
|
|
inherit (containerCfg) port special_param;
|
|
}
|
|
) enabledConfigs;
|
|
mergedContainers = lib.attrsets.mergeAttrsList containerSetsList;
|
|
in
|
|
{
|
|
config = lib.mkIf ( enabledConfigs != {} ) {
|
|
virtualisation.oci-containers = {
|
|
backend = "podman";
|
|
containers = mergedContainers;
|
|
};
|
|
};
|
|
} |