universe/hosts/earth/vpn.nix
2025-03-03 00:00:20 +05:00

16 lines
473 B
Nix

{pkgs, ...}: {
systemd.services.awg0 = {
enable = true;
description = "AmneziaWG Interface awg0";
after = ["network.target"];
wantedBy = ["multi-user.target"];
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";
};
};
}