Add modules/server/containers/apps/.template.nix
This commit is contained in:
44
modules/server/containers/apps/.template.nix
Normal file
44
modules/server/containers/apps/.template.nix
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
{ config, containerCfg, pkgs, lib, builder, name,... }:
|
||||||
|
let
|
||||||
|
serverCfg = config.syscfg.server;
|
||||||
|
image = pkgs.dockerTools.streamLayeredImage {
|
||||||
|
name = "EXAMPLE";
|
||||||
|
tag = "0.0.0";
|
||||||
|
contents = [ pkgs.bashInteractive ];
|
||||||
|
config = {
|
||||||
|
Entrypoint = [ "echo 1" ];
|
||||||
|
ExposedPorts = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
templateData = builder.mkData { name = "template"; dir = "template"; vars = {
|
||||||
|
_ARGUMENT = "template";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
paths = [{
|
||||||
|
path="${serverCfg.configPath}/example/";
|
||||||
|
mode = "0444";
|
||||||
|
}];
|
||||||
|
|
||||||
|
containers = {
|
||||||
|
server = builder.mkContainer {
|
||||||
|
subdomain = containerCfg.subdomain;
|
||||||
|
imageStream = image;
|
||||||
|
port = 8080;
|
||||||
|
secret = name;
|
||||||
|
extraEnv = { };
|
||||||
|
overrides = {
|
||||||
|
cmd = [ ];
|
||||||
|
volumes = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
setup = {
|
||||||
|
trigger = "server";
|
||||||
|
envFile = config.sops.secrets."EXAMPLE".path;
|
||||||
|
script = pkgs.writeShellScript "setup" ''
|
||||||
|
...
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user