universe/hosts/earth/vpn.nix

21 lines
557 B
Nix
Raw Normal View History

2025-03-02 19:00:20 +00:00
{pkgs, ...}: {
systemd.services.awg0 = {
enable = true;
description = "AmneziaWG Interface awg0";
after = ["network.target"];
wantedBy = ["multi-user.target"];
2025-03-02 19:00:36 +00:00
unitConfig = {
ConditionPathExists = "/run/secrets.d/awg0.conf";
};
2025-03-02 19:00:20 +00:00
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${pkgs.amneziawg-tools}/bin/awg-quick up /run/secrets.d/awg0.conf";
ExecStop = "${pkgs.amneziawg-tools}/bin/awg-quick down /run/secrets.d/awg0.conf";
Restart = "on-failure";
};
};
}