mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-07 05:27:13 -06:00
feat: provisioned resources properly across microvms
This commit is contained in:
parent
857f2e39a8
commit
30593b866e
11 changed files with 42 additions and 91 deletions
|
|
@ -15,26 +15,20 @@ in
|
|||
systemd.tmpfiles.rules = [
|
||||
"d ${serviceCfg.mntPaths.path0} 0755 microvm wheel - -"
|
||||
];
|
||||
|
||||
microvm.vms.${serviceCfg.name} = {
|
||||
autostart = true;
|
||||
config = {
|
||||
system.stateVersion = "25.05";
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
22
|
||||
80
|
||||
];
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings.PasswordAuthentication = false;
|
||||
};
|
||||
|
||||
environment.etc."website".source = websitePkg;
|
||||
|
||||
users.users.root.openssh.authorizedKeys.keys = flake.config.people.users.${user0}.sshKeys;
|
||||
|
||||
systemd = {
|
||||
network = {
|
||||
enable = true;
|
||||
|
|
@ -45,21 +39,17 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
virtualHosts.":80".extraConfig = ''
|
||||
root * /etc/website
|
||||
|
||||
file_server
|
||||
|
||||
try_files {path} /index.html
|
||||
'';
|
||||
};
|
||||
|
||||
microvm = {
|
||||
vcpu = 2;
|
||||
mem = 1024;
|
||||
vcpu = 1;
|
||||
mem = 512;
|
||||
hypervisor = "qemu";
|
||||
interfaces = [
|
||||
{
|
||||
|
|
@ -68,7 +58,6 @@ in
|
|||
mac = serviceCfg.interface.mac;
|
||||
}
|
||||
];
|
||||
|
||||
shares = [
|
||||
{
|
||||
source = "/nix/store";
|
||||
|
|
@ -80,16 +69,13 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
virtualHosts.${host}.extraConfig = ''
|
||||
reverse_proxy ${serviceCfg.interface.ip}:80
|
||||
|
||||
tls /var/lib/acme/${host}/fullchain.pem /var/lib/acme/${host}/key.pem
|
||||
'';
|
||||
};
|
||||
|
||||
security.acme.certs.${host} = {
|
||||
dnsProvider = instances.web.dns.provider1;
|
||||
environmentFile = config.sops.secrets."dns/${instances.web.dns.provider1}".path;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue