21 lines
557 B
Nix
21 lines
557 B
Nix
{pkgs, ...}: {
|
|
systemd.services.awg0 = {
|
|
enable = true;
|
|
description = "AmneziaWG Interface awg0";
|
|
after = ["network.target"];
|
|
wantedBy = ["multi-user.target"];
|
|
|
|
unitConfig = {
|
|
ConditionPathExists = "/run/secrets.d/awg0.conf";
|
|
};
|
|
|
|
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";
|
|
};
|
|
};
|
|
}
|