refactor everything
This commit is contained in:
parent
8955b0a13f
commit
d3c4933628
26 changed files with 40 additions and 270 deletions
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
pod = import ./pod.nix;
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue