up number of containers to 4

This commit is contained in:
Cyryl Płotnicki 2022-12-21 14:27:08 +00:00
parent e42f3c95c6
commit f6b61b09e2

View file

@ -21,6 +21,65 @@
}; };
woodpeckerEnvSecretName = "woodpecker-env"; woodpeckerEnvSecretName = "woodpecker-env";
woodpeckerEnvSecretPath = "/run/secrets/${woodpeckerEnvSecretName}"; woodpeckerEnvSecretPath = "/run/secrets/${woodpeckerEnvSecretName}";
woodpeckerAgentContainer = {
autoStart = true;
forwardPorts = [
];
bindMounts = {
"${woodpeckerEnvSecretPath}" = {
hostPath = "${woodpeckerEnvSecretPath}";
isReadOnly = true;
};
"/var/run/docker.sock" = {
hostPath = "/var/run/podman/podman.sock";
isReadOnly = false;
};
};
config = {
config,
pkgs,
lib,
...
}: {
system.stateVersion = "22.11";
users = {
mutableUsers = false;
allowNoPasswordLogin = true;
users."${systemUserName}" = {
inherit uid;
isSystemUser = true;
isNormalUser = false;
group = systemGroupName;
};
groups."${systemGroupName}" = {
inherit gid;
members = ["${systemUserName}"];
};
groups."podman" = {
gid = podmanGid;
members = ["${systemUserName}"];
};
};
systemd.services.woodpecker-agent = {
wantedBy = ["multi-user.target"];
environment = {
WOODPECKER_SERVER = "${domain}:${toString agentPort}";
WOODPECKER_MAX_PROCS = "1";
WOODPECKER_DEBUG_PRETTY = "true";
WOODPECKER_LOG_LEVEL = "info";
};
serviceConfig = {
EnvironmentFile = [
woodpeckerEnvSecretPath
];
ExecStart = "${pkgs.woodpecker-agent}/bin/woodpecker-agent";
User = systemUserName;
Group = systemGroupName;
};
};
};
};
in { in {
imports = [../nginx.nix]; imports = [../nginx.nix];
@ -90,63 +149,8 @@ in {
]; ];
}; };
}; };
containers.woodpecker-agent1 = { containers.woodpecker-agent1 = woodpeckerAgentContainer;
autoStart = true; containers.woodpecker-agent2 = woodpeckerAgentContainer;
forwardPorts = [ containers.woodpecker-agent3 = woodpeckerAgentContainer;
]; containers.woodpecker-agent4 = woodpeckerAgentContainer;
bindMounts = {
"${woodpeckerEnvSecretPath}" = {
hostPath = "${woodpeckerEnvSecretPath}";
isReadOnly = true;
};
"/var/run/docker.sock" = {
hostPath = "/var/run/podman/podman.sock";
isReadOnly = false;
};
};
config = {
config,
pkgs,
lib,
...
}: {
system.stateVersion = "22.11";
users = {
mutableUsers = false;
allowNoPasswordLogin = true;
users."${systemUserName}" = {
inherit uid;
isSystemUser = true;
isNormalUser = false;
group = systemGroupName;
};
groups."${systemGroupName}" = {
inherit gid;
members = ["${systemUserName}"];
};
groups."podman" = {
gid = podmanGid;
members = ["${systemUserName}"];
};
};
systemd.services.woodpecker-agent = {
wantedBy = ["multi-user.target"];
environment = {
WOODPECKER_SERVER = "${domain}:${toString agentPort}";
WOODPECKER_MAX_PROCS = "1";
WOODPECKER_DEBUG_PRETTY = "true";
WOODPECKER_LOG_LEVEL = "info";
};
serviceConfig = {
EnvironmentFile = [
woodpeckerEnvSecretPath
];
ExecStart = "${pkgs.woodpecker-agent}/bin/woodpecker-agent";
User = systemUserName;
Group = systemGroupName;
};
};
};
};
} }