all: cleanup service dependencies

This commit is contained in:
Adithya 2024-11-23 00:22:19 +05:30
parent 247e219e5b
commit 3574b207eb
Signed by: adtya
GPG key ID: B8857BFBA2C47B9C
6 changed files with 17 additions and 8 deletions

View file

@ -1,4 +1,5 @@
_: { _: {
systemd.services.nftables.after = [ "wg-quick-Homelab.service" ];
networking = { networking = {
nftables = { nftables = {
enable = true; enable = true;

View file

@ -20,7 +20,10 @@
} }
''; '';
}; };
systemd.services.caddy.serviceConfig.EnvironmentFile = config.sops.secrets."caddy/env_file".path; systemd.services.caddy = {
after = [ "wg-quick-Homelab.service" ];
serviceConfig.EnvironmentFile = config.sops.secrets."caddy/env_file".path;
};
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowedUDPPorts = [ 80 443 ]; networking.firewall.allowedUDPPorts = [ 80 443 ];
} }

View file

@ -6,7 +6,7 @@
in in
{ {
description = "Dendrite Matrix homeserver"; description = "Dendrite Matrix homeserver";
after = [ "network.target" ]; after = [ "network.target" "wg-quick-Homelab.service" "postgresql.service" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
unitConfig.RequiresMountsFor = [ "/mnt/data" ]; unitConfig.RequiresMountsFor = [ "/mnt/data" ];
serviceConfig = { serviceConfig = {

View file

@ -74,4 +74,5 @@ in
database.createDatabase = true; database.createDatabase = true;
}; };
}; };
systemd.services.forgejo.after = [ "wg-quick-Homelab.service" "postgresql.service" ];
} }

View file

@ -16,11 +16,16 @@ let domainName = "ntfy.acomputer.lol"; in {
}; };
}; };
}; };
systemd.services.ntfy-sh.unitConfig.RequiresMountsFor = [ "/mnt/data" ]; systemd.services.ntfy-sh = {
systemd.services.ntfy-sh.serviceConfig.WorkingDirectory = "/mnt/data/ntfy-sh"; after = [ "wg-quick-Homelab.service" ];
systemd.services.ntfy-sh.serviceConfig.User = "ntfy-sh"; unitConfig.RequiresMountsFor = [ "/mnt/data" ];
systemd.services.ntfy-sh.serviceConfig.Group = "ntfy-sh"; serviceConfig = {
systemd.services.ntfy-sh.serviceConfig.DynamicUser = lib.mkForce false; WorkingDirectory = "/mnt/data/ntfy-sh";
User = "ntfy-sh";
Group = "ntfy-sh";
DynamicUser = lib.mkForce false;
};
};
users.users.ntfy-sh.home = "/mnt/data/ntfy-sh"; users.users.ntfy-sh.home = "/mnt/data/ntfy-sh";
users.users.ntfy-sh.createHome = true; users.users.ntfy-sh.createHome = true;

View file

@ -14,7 +14,6 @@
host all all 127.0.0.1/8 trust host all all 127.0.0.1/8 trust
host all all ::1/128 trust host all all ::1/128 trust
host all all 10.10.10.0/24 trust host all all 10.10.10.0/24 trust
host all all fd7c:585c:c4ae::0/64 trust
''; '';
ensureDatabases = [ "dendrite" "forgejo" ]; ensureDatabases = [ "dendrite" "forgejo" ];
ensureUsers = [ ensureUsers = [