add wants to services using network-online.target

c2853e2588
This commit is contained in:
zowoq 2024-01-22 13:07:47 +10:00
parent ebe2b9186d
commit c03246f531
3 changed files with 5 additions and 0 deletions
hosts/build02
modules/nixos/monitoring

View file

@ -21,6 +21,7 @@ let
mkWorker = name: {
after = [ "network-online.target" "nixpkgs-update-supervisor.service" ];
wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
description = "nixpkgs-update ${name} service";
enable = true;
@ -105,6 +106,7 @@ let
mkFetcher = name: cmd: {
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
path = nixpkgsUpdateSystemDependencies;
# API_TOKEN is used by nixpkgs-update-github-releases
@ -159,6 +161,7 @@ in
systemd.services.nixpkgs-update-delete-done = {
startAt = "daily";
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
description = "nixpkgs-update delete done branches";
restartIfChanged = true;

View file

@ -14,6 +14,7 @@ in
systemd.services.matrix-hook = {
description = "Matrix Hook";
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
environment = {
HTTP_ADDRESS = "localhost";

View file

@ -1,6 +1,7 @@
{ pkgs, ... }:
{
systemd.services.prometheus.after = pkgs.lib.mkForce [ "network-online.target" ];
systemd.services.prometheus.wants = [ "network-online.target" ];
systemd.services.alertmanager.after = [ "prometheus.service" ];
services.prometheus = {