nixos/alloy: set After=network.target

This prevents the network from being torn down before alloy itself it
stopped.

Alloy tries to flush its WAL on SIGTERM, and if the network stack is
already down, it tries to flush logs up to 90s during shutdown/reboot.

From https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/:

> network.target has very little meaning during start-up. It only
> indicates that the network management stack is up after it has been
> reached. Whether any network interfaces are already configured when
> it is reached is undefined. Its primary purpose is for ordering
> things properly at shutdown: since the shutdown ordering of units in
> systemd is the reverse of the startup ordering, any unit that is order
> After=network.target can be sure that it is stopped before the network
> is shut down if the system is powered off. This allows services to
> cleanly terminate connections before going down, instead of abruptly
> losing connectivity for ongoing connections, leaving them in an
> undefined state. […]

Changed files
+1
nixos
modules
services
monitoring
+1
nixos/modules/services/monitoring/alloy.nix
···
config = lib.mkIf cfg.enable {
systemd.services.alloy = {
+
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
reloadTriggers = lib.mapAttrsToList (_: v: v.source or null) (
lib.filterAttrs (n: _: lib.hasPrefix "alloy/" n && lib.hasSuffix ".alloy" n) config.environment.etc