refactor everything

This commit is contained in:
41666 2023-12-27 02:54:59 -05:00
parent 8955b0a13f
commit d3c4933628
26 changed files with 40 additions and 270 deletions

View file

@ -1,3 +1,3 @@
{
pod = import ./pod.nix;
}

View file

@ -1,59 +0,0 @@
{ pkgs, config, lib, ... }:
let
cfg = config.pods;
podOpts = with lib; {
container = mkOption {
type = types.attrsOf (types.submodule ({ options = podContainerOpts; }));
};
exportPorts = mkOption {
type = types.listOf types.str;
};
routes = mkOption {
type = types.attrsOf (types.submodule ({ options = routeOpts; }));
};
};
podContainerOpts = with lib; {
image = mkOption {
type = types.str;
};
ports = mkOption {
type = types.listOf types.str;
};
environment = mkOption {
type = types.attrsOf types.str;
};
secrets = mkOption {
type = types.attrsOf types.path;
};
volumes = mkOption {
type = types.attrsOf types.str;
};
};
routeOpts = with lib; {
port = mkOption {
type = types.str;
};
};
in {
options.pods = with lib; {
enable = mkEnableOption "Enable pod support";
pods = mkOption {
type = types.attrsOf (types.submodule ({ options = podOpts; }));
};
};
config = lib.mkIf cfg.enable {
}
}